diff options
author | Bradley Farias <bfarias@godaddy.com> | 2019-09-30 14:55:59 -0500 |
---|---|---|
committer | Guy Bedford <guybedford@gmail.com> | 2019-10-16 21:50:05 -0400 |
commit | a6b030d5ac2c4a2d34f6b9eb3f945d252a42843e (patch) | |
tree | dfd91dad91d60e90e39db3b5326d509c32a62f5f /lib/internal/bootstrap/loaders.js | |
parent | 1784b7fafac2755f870db3de9eb45a754b7a6477 (diff) | |
download | android-node-v8-a6b030d5ac2c4a2d34f6b9eb3f945d252a42843e.tar.gz android-node-v8-a6b030d5ac2c4a2d34f6b9eb3f945d252a42843e.tar.bz2 android-node-v8-a6b030d5ac2c4a2d34f6b9eb3f945d252a42843e.zip |
module: refactor modules bootstrap
PR-URL: https://github.com/nodejs/node/pull/29937
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'lib/internal/bootstrap/loaders.js')
-rw-r--r-- | lib/internal/bootstrap/loaders.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js index 775fea064e..48afed2556 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -220,7 +220,10 @@ NativeModule.prototype.compileForPublicLoader = function(needToSyncExports) { this.compile(); if (needToSyncExports) { if (!this.exportKeys) { - this.exportKeys = Object.keys(this.exports); + // 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(); |