diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-07-07 20:57:50 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-07-07 21:04:15 +0200 |
commit | 96f140bd8c39ccb44efa630b0ff6096d53b94456 (patch) | |
tree | 2a149ebaa7e7f47b5baf93ccd2d33d35142f7ed0 /examples/execute-string.c | |
parent | df5db5f1deb809b8570185b2fd046a38db13537d (diff) |
lib, vm: ensure that require() compiles modules only once
Cache the result of a successful require operation in a global.modules
object and return the cached value for subsequent require calls on the
same module name.
This ensures that a given module is only compiled and executed once,
regardless of how many times it is used.
A reload of the module can be forced by deleting the corresponding
key in the global module table.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'examples/execute-string.c')
0 files changed, 0 insertions, 0 deletions