diff options
author | Guy Bedford <guybedford@gmail.com> | 2019-10-11 17:57:13 -0400 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2019-11-12 14:04:55 -0800 |
commit | 796f3d0af49164314868c4778af90eca356f1fef (patch) | |
tree | f1b8d619df36917b03ba035630f389e1da305712 /lib/internal/bootstrap/loaders.js | |
parent | cc6f99de449beb0993db3647de4ef979bead804d (diff) | |
download | android-node-v8-796f3d0af49164314868c4778af90eca356f1fef.tar.gz android-node-v8-796f3d0af49164314868c4778af90eca356f1fef.tar.bz2 android-node-v8-796f3d0af49164314868c4778af90eca356f1fef.zip |
esm: unflag --experimental-modules
PR-URL: https://github.com/nodejs/node/pull/29866
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'lib/internal/bootstrap/loaders.js')
-rw-r--r-- | lib/internal/bootstrap/loaders.js | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js index 48afed2556..1915dc6674 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -211,23 +211,21 @@ function requireWithFallbackInDeps(request) { } // This is exposed for public loaders -NativeModule.prototype.compileForPublicLoader = function(needToSyncExports) { +NativeModule.prototype.compileForPublicLoader = function() { if (!this.canBeRequiredByUsers) { // No code because this is an assertion against bugs // eslint-disable-next-line no-restricted-syntax throw new Error(`Should not compile ${this.id} for public use`); } this.compile(); - if (needToSyncExports) { - if (!this.exportKeys) { - // When using --expose-internals, we do not want to reflect the named - // exports from core modules as this can trigger unnecessary getters. - const internal = this.id.startsWith('internal/'); - this.exportKeys = internal ? [] : Object.keys(this.exports); - } - this.getESMFacade(); - this.syncExports(); + if (!this.exportKeys) { + // When using --expose-internals, we do not want to reflect the named + // exports from core modules as this can trigger unnecessary getters. + const internal = this.id.startsWith('internal/'); + this.exportKeys = internal ? [] : Object.keys(this.exports); } + this.getESMFacade(); + this.syncExports(); return this.exports; }; |