aboutsummaryrefslogtreecommitdiff
path: root/lib/internal/modules/esm
diff options
context:
space:
mode:
authorBradley Farias <bfarias@godaddy.com>2019-09-27 12:12:18 -0500
committerGuy Bedford <guybedford@gmail.com>2019-10-05 20:11:15 -0400
commit0b495a899bdf9a26b25a6e31177512531c841e0e (patch)
treed0c3a6b3768c0882ddf2eae1a01df419b50bb38f /lib/internal/modules/esm
parente1e2f669f65fd53323b8a58d80ed3cee039706b7 (diff)
downloadandroid-node-v8-0b495a899bdf9a26b25a6e31177512531c841e0e.tar.gz
android-node-v8-0b495a899bdf9a26b25a6e31177512531c841e0e.tar.bz2
android-node-v8-0b495a899bdf9a26b25a6e31177512531c841e0e.zip
esm: remove proxy for builtin exports
PR-URL: https://github.com/nodejs/node/pull/29737 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'lib/internal/modules/esm')
-rw-r--r--lib/internal/modules/esm/translators.js10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
index 056bf64bf5..e8eddcfd21 100644
--- a/lib/internal/modules/esm/translators.js
+++ b/lib/internal/modules/esm/translators.js
@@ -128,14 +128,8 @@ translators.set('builtin', async function builtinStrategy(url) {
if (!module) {
throw new ERR_UNKNOWN_BUILTIN_MODULE(id);
}
- return createDynamicModule(
- [], [...module.exportKeys, 'default'], url, (reflect) => {
- debug(`Loading BuiltinModule ${url}`);
- module.reflect = reflect;
- for (const key of module.exportKeys)
- reflect.exports[key].set(module.exports[key]);
- reflect.exports.default.set(module.exports);
- });
+ debug(`Loading BuiltinModule ${url}`);
+ return module.getESMFacade();
});
// Strategy for loading a JSON file