summaryrefslogtreecommitdiff
path: root/tests/testdata/workers/deno_worker.ts
blob: 9928b378b4e470406abb0a15e708f5f137000011 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { assert } from "../../../tests/util/std/assert/mod.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);
};