diff options
author | Jan Krems <jan.krems@groupon.com> | 2017-10-01 10:31:04 -0700 |
---|---|---|
committer | Jan Krems <jan.krems@groupon.com> | 2017-11-29 14:16:43 -0800 |
commit | 59e48329d00cd91f6836cd91bcb8aca92acac1f6 (patch) | |
tree | 333e94c37e83ed75039c56defdc02df36ece6275 /lib/module.js | |
parent | b28af4dc26139778223fe61a886093a7d0e85c1f (diff) | |
download | node-new-59e48329d00cd91f6836cd91bcb8aca92acac1f6.tar.gz |
module: Set dynamic import callback
This is an initial implementation to support dynamic import in
both scripts and modules. It's off by default since support for
dynamic import is still flagged in V8. Without setting the V8 flag,
this code won't be executed.
This initial version does not support importing into vm contexts.
PR-URL: https://github.com/nodejs/node/pull/15713
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Diffstat (limited to 'lib/module.js')
-rw-r--r-- | lib/module.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/module.js b/lib/module.js index f404c4317d..4c4ceaf847 100644 --- a/lib/module.js +++ b/lib/module.js @@ -472,6 +472,7 @@ Module._load = function(request, parent, isMain) { ESMLoader.hook(hooks); } } + Loader.registerImportDynamicallyCallback(ESMLoader); await ESMLoader.import(getURLFromFilePath(request).pathname); })() .catch((e) => { |