MCPcopy
hub / github.com/webpack/webpack / constructor

Method constructor

test/configCases/worker/blob/worker-wrapper.js:4–12  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

2 _worker;
3
4 constructor(url) {
5 const objectURL = URL.createObjectURL(
6 new Blob([`importScripts(${JSON.stringify(url.toString())});`], {
7 type: 'application/javascript'
8 })
9 );
10 this._worker = new Worker(objectURL, { originalURL: url });
11 URL.revokeObjectURL(objectURL);
12 }
13
14 getWorker() {
15 return this._worker;

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected