remove bootstrap methods from global scope after bootstrapping (#4869)

This commit is contained in:
Bartek Iwańczuk 2020-04-25 01:03:45 +02:00 committed by GitHub
parent 912a57f6a2
commit 1378df3364
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 42 additions and 39 deletions

View file

@ -126,6 +126,9 @@ export function bootstrapWorkerRuntime(
if (hasBootstrapped) {
throw new Error("Worker runtime already bootstrapped");
}
// Remove bootstrapping methods from global scope
// @ts-ignore
globalThis.bootstrap = undefined;
log("bootstrapWorkerRuntime");
hasBootstrapped = true;
Object.defineProperties(globalThis, windowOrWorkerGlobalScopeMethods);