1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 /* eslint-env worker */
7 // This file expects utils.js to be included in its scope
8 /* import-globals-from ./util.js */
9 importScripts("util.js");
10 importScripts("test-vectors.js");
14 function finish(result) {
18 function complete(test, valid) {
28 function memcmp_complete(test, value) {
30 finish(util.memcmp(x, value));
40 onmessage = function (msg) {
41 // eslint-disable-next-line no-eval
42 var test = eval("(" + msg.data + ")");
45 test.call({ complete: finish });
47 error(`Failed to run worker test: ${err}\n`);