fune/toolkit/components/workerloader/tests/utils_worker.js
Jared Wein ecab54a7c9 Bug 1325464 - Enable object-shorthand rule and run 'mach eslint --fix' with the rule enabled. r=MattN
MozReview-Commit-ID: 7E7LPorrEje

--HG--
extra : rebase_source : 0572a35415a766a3f31d266760ecd07f0dcc3f72
2016-12-29 18:34:54 -05:00

32 lines
906 B
JavaScript

/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
function log(text) {
dump("WORKER " + text + "\n");
}
function send(message) {
self.postMessage(message);
}
function finish() {
send({kind: "finish"});
}
function ok(condition, description) {
send({kind: "ok", condition: !!condition, description: "" + description});
}
function is(a, b, description) {
let outcome = a == b; // Need to decide outcome here, as not everything can be serialized
send({kind: "is", outcome, description: "" + description, a: "" + a, b: "" + b});
}
function isnot(a, b, description) {
let outcome = a != b; // Need to decide outcome here, as not everything can be serialized
send({kind: "isnot", outcome, description: "" + description, a: "" + a, b: "" + b});
}
function info(description) {
send({kind: "info", description: "" + description});
}