MCPcopy
hub / github.com/webpack/webpack / createBaseEsmContext

Method createBaseEsmContext

test/harness/runner/index.js:323–340  ·  view source on GitHub ↗

* @returns {EXPECTED_ANY} esm context

()

Source from the content-addressed store, hash-verified

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

Callers 1

constructorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected