feat(workers): Make the Deno namespace configurable and unfrozen (#11888)

This is the worker counterpart of PR #11062.
This commit is contained in:
Andreu Botella 2021-08-31 19:33:03 +02:00 committed by GitHub
parent b518f5e1ba
commit c49eee551f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 16 deletions

View file

@ -1,7 +1,16 @@
import { assert } from "../../../../test_util/std/testing/asserts.ts";
onmessage = function (e) {
if (typeof self.Deno === "undefined") {
throw new Error("Deno namespace not available in worker");
}
assert(!Object.isFrozen(self.Deno));
const desc = Object.getOwnPropertyDescriptor(self, "Deno");
assert(desc);
assert(desc.configurable);
assert(!desc.writable);
postMessage(e.data);
};