diff options
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(); |