forked from WebKit/WebKit-http
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ref-spec-harness.js
38 lines (32 loc) · 887 Bytes
/
ref-spec-harness.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"use strict";
// This is our nifty way to make modules synchronous.
let assert;
import('./assert.js').then((module) => {
assert = module;
}, $vm.crash);
drainMicrotasks();
function test(func, description) {
try {
func();
} catch (e) {
print("Unexpected exception:", description);
throw e;
}
}
function promise_test(func, description) {
assert.asyncTest(func());
};
let assert_equals = assert.eq;
let assert_true = (x) => assert.eq(x,true);
let assert_false = (x) => assert.eq(x,false);
let assert_unreached = () => {
throw new Error("Should have been unreachable");
};
let console = {
log(...args) {
print(...args);
}
};
load("./ref-spec-harness/sync_index.js", "caller relative");
load("./ref-spec-harness/wasm-constants.js", "caller relative");
load("./ref-spec-harness/wasm-module-builder.js", "caller relative");