MCPcopy Index your code
hub / github.com/nodejs/node / compileForPublicLoader

Method compileForPublicLoader

lib/internal/bootstrap/realm.js:340–354  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

338
339 // Used by user-land module loaders to compile and load builtins.
340 compileForPublicLoader() {
341 if (!BuiltinModule.canBeRequiredByUsers(this.id)) {
342 // No code because this is an assertion against bugs
343 // eslint-disable-next-line no-restricted-syntax
344 throw new Error(`Should not compile ${this.id} for public use`);
345 }
346 this.compileForInternalLoader();
347 if (!this.exportKeys) {
348 // When using --expose-internals, we do not want to reflect the named
349 // exports from core modules as this can trigger unnecessary getters.
350 const internal = StringPrototypeStartsWith(this.id, 'internal/');
351 this.exportKeys = internal ? [] : ObjectKeys(this.exports);
352 }
353 return this.exports;
354 }
355
356 getESMFacade() {
357 if (this.module) return this.module;

Callers 1

loadBuiltinModuleFunction · 0.80

Calls 2

canBeRequiredByUsersMethod · 0.80

Tested by

no test coverage detected