()
| 354 | } |
| 355 | |
| 356 | getESMFacade() { |
| 357 | if (this.module) return this.module; |
| 358 | const url = `node:${this.id}`; |
| 359 | const builtin = this; |
| 360 | const exportsKeys = ArrayPrototypeSlice(this.exportKeys); |
| 361 | if (!ArrayPrototypeIncludes(exportsKeys, 'default')) { |
| 362 | ArrayPrototypePush(exportsKeys, 'default'); |
| 363 | } |
| 364 | this.module = new ModuleWrap( |
| 365 | url, undefined, exportsKeys, |
| 366 | function() { |
| 367 | builtin.syncExports(); |
| 368 | this.setExport('default', builtin.exports); |
| 369 | }); |
| 370 | // Ensure immediate sync execution to capture exports now |
| 371 | this.module.instantiate(); |
| 372 | this.module.evaluate(-1, false); |
| 373 | return this.module; |
| 374 | } |
| 375 | |
| 376 | // Provide named exports for all builtin libraries so that the libraries |
| 377 | // may be imported in a nicer way for ESM users. The default export is left |
no test coverage detected