summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/import-meta/postmessage-worker.js
blob: 3618137aef97a223c871439864386f3455eae0cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
if ('DedicatedWorkerGlobalScope' in self &&
    self instanceof DedicatedWorkerGlobalScope) {
  postMessage(import.meta.url);
} else if (
    'SharedWorkerGlobalScope' in self &&
    self instanceof SharedWorkerGlobalScope) {
  self.onconnect = function(e) {
    const port = e.ports[0];
    port.start();
    port.postMessage(import.meta.url);
  };
}