fune/dom/workers/test/chromeWorker_worker.js
Victor Porof 0a8ff0ad85 Bug 1561435 - Format dom/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35951

--HG--
extra : source : 62f3501af4bc1c0bd1ee1977a28aee04706a6663
2019-07-05 10:44:55 +02:00

20 lines
530 B
JavaScript

/**
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
if (!("ctypes" in self)) {
throw "No ctypes!";
}
// Go ahead and verify that the ctypes lazy getter actually works.
if (ctypes.toString() != "[object ctypes]") {
throw "Bad ctypes object: " + ctypes.toString();
}
onmessage = function(event) {
let worker = new ChromeWorker("chromeWorker_subworker.js");
worker.onmessage = function(msg) {
postMessage(msg.data);
};
worker.postMessage(event.data);
};