summaryrefslogtreecommitdiff
path: root/lib/internal/bootstrap/loaders.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/internal/bootstrap/loaders.js')
-rw-r--r--lib/internal/bootstrap/loaders.js18
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;
};