feat: Deno namespace configurable and unfrozen (#11062)

Closes #11033
This commit is contained in:
Kitson Kelly 2021-06-22 07:17:35 +10:00 committed by GitHub
parent 2d2b5625e0
commit cda15f2a98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 45 deletions

View file

@ -117,6 +117,7 @@
return {
value,
writable: true,
enumerable: false,
configurable: true,
};
}
@ -125,6 +126,8 @@
return {
value,
enumerable: true,
writable: false,
configurable: true,
};
}
@ -132,6 +135,7 @@
return {
get: getter,
enumerable: true,
configurable: true,
};
}

View file

@ -492,10 +492,9 @@ delete Object.prototype.__proto__;
Object.assign(finalDenoNs, denoNsUnstable);
}
// Setup `Deno` global - we're actually overriding already
// existing global `Deno` with `Deno` namespace from "./deno.ts".
util.immutableDefine(globalThis, "Deno", finalDenoNs);
Object.freeze(globalThis.Deno);
// Setup `Deno` global - we're actually overriding already existing global
// `Deno` with `Deno` namespace from "./deno.ts".
Object.defineProperty(globalThis, "Deno", util.readOnly(finalDenoNs));
Object.freeze(globalThis.Deno.core);
Object.freeze(globalThis.Deno.core.sharedQueue);
signals.setSignals();