* @returns {EXPECTED_ANY} esm context
()
| 321 | * @returns {EXPECTED_ANY} esm context |
| 322 | */ |
| 323 | createBaseEsmContext() { |
| 324 | const base = { |
| 325 | global, |
| 326 | process, |
| 327 | setTimeout, |
| 328 | clearTimeout, |
| 329 | setImmediate, |
| 330 | URL, |
| 331 | Buffer, |
| 332 | TextEncoder: typeof TextEncoder !== "undefined" ? TextEncoder : undefined, |
| 333 | TextDecoder: typeof TextDecoder !== "undefined" ? TextDecoder : undefined, |
| 334 | // expose the Deno/Bun runtime globals to bundles when running under |
| 335 | // them; `global` (not `globalThis`) keeps this working on Node.js 10 |
| 336 | Deno: /** @type {EXPECTED_ANY} */ (global).Deno, |
| 337 | Bun: /** @type {EXPECTED_ANY} */ (global).Bun |
| 338 | }; |
| 339 | return base; |
| 340 | } |
| 341 | |
| 342 | /** |
| 343 | * @param {EXPECTED_ANY} globalContext global context |