summaryrefslogtreecommitdiff
path: root/lib/vm.js
diff options
context:
space:
mode:
authorGus Caplan <me@gus.host>2018-01-13 23:35:51 -0800
committerTimothy Gu <timothygu99@gmail.com>2018-01-30 17:00:57 -0800
commit0993fbe5b213d0fe746c3162bcda85f6c66bb552 (patch)
treef0a1ffef2ab24f1da963a23a43f3dd58eed5bba0 /lib/vm.js
parent2033a9f4362ee46b0fbddf9caf9cf6238391561e (diff)
downloadandroid-node-v8-0993fbe5b213d0fe746c3162bcda85f6c66bb552.tar.gz
android-node-v8-0993fbe5b213d0fe746c3162bcda85f6c66bb552.tar.bz2
android-node-v8-0993fbe5b213d0fe746c3162bcda85f6c66bb552.zip
vm: add modules
Adds vm.Module, which wraps around ModuleWrap to provide an interface for developers to work with modules in a more reflective manner. Co-authored-by: Timothy Gu <timothygu99@gmail.com> PR-URL: https://github.com/nodejs/node/pull/17560 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Diffstat (limited to 'lib/vm.js')
-rw-r--r--lib/vm.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/vm.js b/lib/vm.js
index ec05ad774a..c9bb44f057 100644
--- a/lib/vm.js
+++ b/lib/vm.js
@@ -192,5 +192,8 @@ module.exports = {
runInContext,
runInNewContext,
runInThisContext,
- isContext
+ isContext,
};
+
+if (process.binding('config').experimentalVMModules)
+ module.exports.Module = require('internal/vm/Module').Module;