summaryrefslogtreecommitdiff
path: root/lib/internal/modules/esm/loader.js
diff options
context:
space:
mode:
authorGuy Bedford <guybedford@gmail.com>2019-10-04 13:37:27 -0400
committerGuy Bedford <guybedford@gmail.com>2019-10-06 13:30:11 -0400
commitffd22e81983056d09c064c59343a0e488236272d (patch)
treebf6df052e03191935ed7032f6d2c86e18cd886b3 /lib/internal/modules/esm/loader.js
parent0521a98fd6dfbd31994709f0f417c470f98d2b71 (diff)
downloadandroid-node-v8-ffd22e81983056d09c064c59343a0e488236272d.tar.gz
android-node-v8-ffd22e81983056d09c064c59343a0e488236272d.tar.bz2
android-node-v8-ffd22e81983056d09c064c59343a0e488236272d.zip
module: use v8 synthetic modules
PR-URL: https://github.com/nodejs/node/pull/29846 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Diffstat (limited to 'lib/internal/modules/esm/loader.js')
-rw-r--r--lib/internal/modules/esm/loader.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/internal/modules/esm/loader.js b/lib/internal/modules/esm/loader.js
index 9800e8a550..138cf8b5ec 100644
--- a/lib/internal/modules/esm/loader.js
+++ b/lib/internal/modules/esm/loader.js
@@ -117,12 +117,7 @@ class Loader {
source,
url = pathToFileURL(`${process.cwd()}/[eval${++this.evalIndex}]`).href
) {
- const evalInstance = async (url) => {
- return {
- module: new ModuleWrap(source, url),
- reflect: undefined
- };
- };
+ const evalInstance = (url) => new ModuleWrap(source, url);
const job = new ModuleJob(this, url, evalInstance, false);
this.moduleMap.set(url, job);
const { module, result } = await job.run();
@@ -165,7 +160,7 @@ class Loader {
return createDynamicModule([], exports, url, (reflect) => {
debug(`Loading dynamic ${url}`);
execute(reflect.exports);
- });
+ }).module;
};
} else {
if (!translators.has(format))