()
| 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; |
no test coverage detected