diff options
author | Gus Caplan <me@gus.host> | 2019-10-04 20:08:00 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-10-14 14:25:38 -0700 |
commit | f9caee986cae09cd4cb47e0a02a5b8672ab2c16d (patch) | |
tree | 5f5171ac3a976dfe81ee0667bc2f49afc1921ec1 /lib/vm.js | |
parent | 7991b57cfdba96ddcd6553c8233cd6392e16a42a (diff) | |
download | android-node-v8-f9caee986cae09cd4cb47e0a02a5b8672ab2c16d.tar.gz android-node-v8-f9caee986cae09cd4cb47e0a02a5b8672ab2c16d.tar.bz2 android-node-v8-f9caee986cae09cd4cb47e0a02a5b8672ab2c16d.zip |
vm: add Synthetic modules
- Refactor vm.SourceTextModule (again)
- Add vm.Module abstract superclass
- Add vm.SyntheticModule
Refs: https://heycam.github.io/webidl/#synthetic-module-records
PR-URL: https://github.com/nodejs/node/pull/29864
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Diffstat (limited to 'lib/vm.js')
-rw-r--r-- | lib/vm.js | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -99,7 +99,7 @@ class Script extends ContextifyScript { importModuleDynamically); } const { importModuleDynamicallyWrap } = - require('internal/vm/source_text_module'); + require('internal/vm/module'); const { callbackMap } = internalBinding('module_wrap'); callbackMap.set(this, { importModuleDynamically: @@ -409,6 +409,10 @@ module.exports = { }; if (require('internal/options').getOptionValue('--experimental-vm-modules')) { - const { SourceTextModule } = require('internal/vm/source_text_module'); + const { + Module, SourceTextModule, SyntheticModule, + } = require('internal/vm/module'); + module.exports.Module = Module; module.exports.SourceTextModule = SourceTextModule; + module.exports.SyntheticModule = SyntheticModule; } |