1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-14 16:33:45 -05:00
denoland-deno/cli/tests/testdata/workers/deno_worker.ts
2021-08-31 19:33:03 +02:00

16 lines
409 B
TypeScript

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);
};