Skip to content
Snippets Groups Projects
Commit 2aa6e441 authored by Benjamin Bouvier's avatar Benjamin Bouvier
Browse files

Bug 1332691: Make a testharness.js polyfill for Spidermonkey; r=luke

MozReview-Commit-ID: IWhymoUJgJ7

--HG--
extra : rebase_source : d1faa7408ed1d7b795e0d52df02401d29bcdc9f2
parent 07beccf9
No related branches found
No related tags found
No related merge requests found
if (!wasmIsSupported())
quit();
load(scriptdir + 'harness/index.js');
load(scriptdir + 'harness/wasm-constants.js');
load(scriptdir + 'harness/wasm-module-builder.js');
function test(func, description) {
let maybeErr;
try {
func();
} catch(e) {
maybeErr = e;
}
if (typeof maybeErr !== 'undefined') {
throw new Error(`${description}: FAIL.
${maybeErr}
${maybeErr.stack}`);
} else {
print(`${description}: PASS.`);
}
}
function promise_test(func, description) {
func()
.then(_ => {
print(`${description}: PASS.`);
})
.catch(err => {
print(`${description}: FAIL.
${err}`);
});
drainJobQueue();
}
let assert_equals = assertEq;
let assert_true = (x, errMsg) => { assertEq(x, true); }
let assert_false = (x, errMsg) => { assertEq(x, false); }
function assert_unreached(description) {
throw new Error(`unreachable:\n${description}`);
}
setJitCompilerOption('wasm.test-mode', 1);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment