diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a79f7ab22af7e2..e4241de7d42e75 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -125,7 +125,7 @@ # Startup -/benchmark/misc/startup.js @nodejs/startup +/benchmark/misc/startup-* @nodejs/startup /lib/internal/bootstrap/* @nodejs/startup /src/node_builtins* @nodejs/startup /src/node_realm* @nodejs/startup @nodejs/realm diff --git a/benchmark/misc/startup.js b/benchmark/misc/startup-core.js similarity index 100% rename from benchmark/misc/startup.js rename to benchmark/misc/startup-core.js diff --git a/lib/internal/bootstrap/realm.js b/lib/internal/bootstrap/realm.js index 0ebec1c02d0c0d..9cb6a8add714d0 100644 --- a/lib/internal/bootstrap/realm.js +++ b/lib/internal/bootstrap/realm.js @@ -198,6 +198,9 @@ const { setInternalLoaders, } = internalBinding('builtins'); +const { ModuleWrap } = internalBinding('module_wrap'); +ObjectSetPrototypeOf(ModuleWrap.prototype, null); + const getOwn = (target, property, receiver) => { return ObjectPrototypeHasOwnProperty(target, property) ? ReflectGet(target, property, receiver) : @@ -338,16 +341,11 @@ class BuiltinModule { const internal = StringPrototypeStartsWith(this.id, 'internal/'); this.exportKeys = internal ? [] : ObjectKeys(this.exports); } - this.getESMFacade(); - this.syncExports(); return this.exports; } getESMFacade() { if (this.module) return this.module; - const { ModuleWrap } = internalBinding('module_wrap'); - // TODO(aduh95): move this to C++, alongside the initialization of the class. - ObjectSetPrototypeOf(ModuleWrap.prototype, null); const url = `node:${this.id}`; const builtin = this; const exportsKeys = ArrayPrototypeSlice(this.exportKeys);