gecko-dev/dom/workers/test/WorkerDebuggerGlobalScope.s...

13 строки
201 B
JavaScript

"use strict";
this.onmessage = function (event) {
switch (event.data) {
case "ping":
setImmediate(function () {
postMessage("pong1");
});
postMessage("pong2");
break;
}
};