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

@ -407,16 +407,13 @@ function bootstrapWasmCompilerRuntime(): void {
delete (Object.prototype as any).__proto__;
Object.defineProperties(globalThis, {
bootstrapWasmCompilerRuntime: {
value: bootstrapWasmCompilerRuntime,
enumerable: false,
writable: false,
configurable: false,
},
bootstrapTsCompilerRuntime: {
value: bootstrapTsCompilerRuntime,
enumerable: false,
writable: false,
configurable: false,
bootstrap: {
value: {
...globalThis.bootstrap,
wasmCompilerRuntime: bootstrapWasmCompilerRuntime,
tsCompilerRuntime: bootstrapTsCompilerRuntime,
},
configurable: true,
writable: true,
},
});