summaryrefslogtreecommitdiff
path: root/cli/js/runtime_worker.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/runtime_worker.ts')
-rw-r--r--cli/js/runtime_worker.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/js/runtime_worker.ts b/cli/js/runtime_worker.ts
index 7f1d1b69c..0dc65fdb6 100644
--- a/cli/js/runtime_worker.ts
+++ b/cli/js/runtime_worker.ts
@@ -54,7 +54,7 @@ export async function getMessage(): Promise<any> {
let isClosing = false;
let hasBootstrapped = false;
-export function workerClose(): void {
+export function close(): void {
isClosing = true;
}
@@ -102,7 +102,7 @@ export const workerRuntimeGlobalProperties = {
self: readOnly(globalThis),
onmessage: writable(onmessage),
onerror: writable(onerror),
- workerClose: nonEnumerable(workerClose),
+ close: nonEnumerable(close),
postMessage: writable(postMessage)
};
@@ -122,5 +122,6 @@ export function bootstrapWorkerRuntime(name: string): void {
Object.defineProperties(globalThis, windowOrWorkerGlobalScopeProperties);
Object.defineProperties(globalThis, workerRuntimeGlobalProperties);
Object.defineProperties(globalThis, eventTargetProperties);
+ Object.defineProperties(globalThis, { name: readOnly(name) });
runtime.start(false, name);
}