diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-04-14 17:41:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-14 17:41:06 +0200 |
commit | e08ece2d2cc2c39b067dc271f52516bdee7c06ca (patch) | |
tree | 1da0e54feb757784902c4619218900110c37a2e3 /cli/js | |
parent | cb5dd69dda4872533b05a4e9184f7e35f21c2010 (diff) |
fix(worker): make worker name spec compliant (#4746)
Diffstat (limited to 'cli/js')
-rw-r--r-- | cli/js/runtime_worker.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cli/js/runtime_worker.ts b/cli/js/runtime_worker.ts index 8881b438b..1e7a9a67d 100644 --- a/cli/js/runtime_worker.ts +++ b/cli/js/runtime_worker.ts @@ -107,7 +107,10 @@ export const workerRuntimeGlobalProperties = { workerMessageRecvCallback: nonEnumerable(workerMessageRecvCallback), }; -export function bootstrapWorkerRuntime(name: string): void { +export function bootstrapWorkerRuntime( + name: string, + internalName?: string +): void { if (hasBootstrapped) { throw new Error("Worker runtime already bootstrapped"); } @@ -119,7 +122,7 @@ export function bootstrapWorkerRuntime(name: string): void { Object.defineProperties(globalThis, eventTargetProperties); Object.defineProperties(globalThis, { name: readOnly(name) }); setEventTargetData(globalThis); - const s = runtime.start(name); + const s = runtime.start(internalName ?? name); const location = new LocationImpl(s.location); immutableDefine(globalThis, "location", location); |