mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
16 lines
376 B
TypeScript
16 lines
376 B
TypeScript
import { assert } from "@std/assert";
|
|
|
|
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);
|
|
};
|