MCPcopy
hub / github.com/webpack/webpack / createBaseModuleScope

Method createBaseModuleScope

test/harness/runner/index.js:300–318  ·  view source on GitHub ↗

* @returns {EXPECTED_ANY} moduleScope

()

Source from the content-addressed store, hash-verified

298 * @returns {EXPECTED_ANY} moduleScope
299 */
300 createBaseModuleScope() {
301 const base = {
302 console,
303 expect,
304 jest,
305 nsObj: (/** @type {EXPECTED_ANY} */ m) => {
306 Object.defineProperty(m, Symbol.toStringTag, {
307 value: "Module"
308 });
309 return m;
310 }
311 };
312 Object.assign(base, this._globalContext);
313 if (this.jsDom()) {
314 /** @type {EXPECTED_ANY} */ (base).window = this._globalContext;
315 /** @type {EXPECTED_ANY} */ (base).self = this._globalContext;
316 }
317 return base;
318 }
319
320 /**
321 * @returns {EXPECTED_ANY} esm context

Callers 1

constructorMethod · 0.95

Calls 1

jsDomMethod · 0.95

Tested by

no test coverage detected