diff options
author | Gus Caplan <me@gus.host> | 2019-09-09 12:20:16 -0500 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-10-02 15:54:35 -0700 |
commit | 5e7946fe79193633e9a78aae48548635cbc11023 (patch) | |
tree | 4ef3ab236df6aa8d570e22453dbe56b37487ad63 /lib/internal/modules/esm | |
parent | 6ba9471f6fcaaf377f22621c4d193d30e3877566 (diff) | |
download | android-node-v8-5e7946fe79193633e9a78aae48548635cbc11023.tar.gz android-node-v8-5e7946fe79193633e9a78aae48548635cbc11023.tar.bz2 android-node-v8-5e7946fe79193633e9a78aae48548635cbc11023.zip |
vm: refactor SourceTextModule
- Removes redundant `instantiate` method
- Refactors `link` to match the spec linking steps more accurately
- Removes URL validation from SourceTextModule specifiers
- DRYs some dynamic import logic
Closes: https://github.com/nodejs/node/issues/29030
Co-Authored-By: Michaël Zasso <targos@protonmail.com>
PR-URL: https://github.com/nodejs/node/pull/29776
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Diffstat (limited to 'lib/internal/modules/esm')
-rw-r--r-- | lib/internal/modules/esm/loader.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/internal/modules/esm/loader.js b/lib/internal/modules/esm/loader.js index 09109d3c71..9800e8a550 100644 --- a/lib/internal/modules/esm/loader.js +++ b/lib/internal/modules/esm/loader.js @@ -127,7 +127,7 @@ class Loader { this.moduleMap.set(url, job); const { module, result } = await job.run(); return { - namespace: module.namespace(), + namespace: module.getNamespace(), result }; } @@ -135,7 +135,7 @@ class Loader { async import(specifier, parent) { const job = await this.getModuleJob(specifier, parent); const { module } = await job.run(); - return module.namespace(); + return module.getNamespace(); } hook({ resolve, dynamicInstantiate }) { |