summaryrefslogtreecommitdiffstats
path: root/dom/workers/test/WorkerDebuggerGlobalScope.enterEventLoop_worker.js
blob: c43738516163b6ebc95e9e5b4c2e4da4ca25ba6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"use strict";

function f() {
  debugger;
}

var worker = new Worker("WorkerDebuggerGlobalScope.enterEventLoop_childWorker.js");

worker.onmessage = function (event) {
  postMessage("child:" + event.data);
};

self.onmessage = function (event) {
  var message = event.data;
  if (message.indexOf(":") >= 0) {
    worker.postMessage(message.split(":")[1]);
    return;
  }
  switch (message) {
  case "ping":
    debugger;
    postMessage("pong");
    break;
  };
};