diff --git a/implementation-contributed/javascriptcore/wasm/function-tests/invalid-duplicate-export.js b/implementation-contributed/javascriptcore/wasm/function-tests/invalid-duplicate-export.js index c47b1e1662..418d51aa49 100644 --- a/implementation-contributed/javascriptcore/wasm/function-tests/invalid-duplicate-export.js +++ b/implementation-contributed/javascriptcore/wasm/function-tests/invalid-duplicate-export.js @@ -15,5 +15,5 @@ import * as assert from '../assert.js'; .End(); const bin = builder.WebAssembly().get(); - assert.throws(() => new WebAssembly.Module(bin), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 31 / 39: duplicate export: 'foo'"); + assert.throws(() => new WebAssembly.Module(bin), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 31: duplicate export: 'foo'"); } diff --git a/implementation-contributed/javascriptcore/wasm/function-tests/memory-alignment.js b/implementation-contributed/javascriptcore/wasm/function-tests/memory-alignment.js index abc5741214..e605898900 100644 --- a/implementation-contributed/javascriptcore/wasm/function-tests/memory-alignment.js +++ b/implementation-contributed/javascriptcore/wasm/function-tests/memory-alignment.js @@ -42,7 +42,7 @@ for (const op of WASM.opcodes("memory")) { if (alignLog2 <= maxAlignLog2) instance(); else - assert.throws(instance, WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte ${start} / ${end}: byte alignment ${1 << alignLog2} exceeds ${info.type}'s natural alignment ${1 << maxAlignLog2}, in function at index 0`); + assert.throws(instance, WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte ${start}: byte alignment ${1 << alignLog2} exceeds ${info.type}'s natural alignment ${1 << maxAlignLog2}, in function at index 0`); } } diff --git a/implementation-contributed/javascriptcore/wasm/function-tests/memory-section-and-import.js b/implementation-contributed/javascriptcore/wasm/function-tests/memory-section-and-import.js index a1db9ce257..15207ef718 100644 --- a/implementation-contributed/javascriptcore/wasm/function-tests/memory-section-and-import.js +++ b/implementation-contributed/javascriptcore/wasm/function-tests/memory-section-and-import.js @@ -28,4 +28,4 @@ const builder1 = (new Builder()) .Code().End(); const i0 = instantiate(builder0); -assert.throws(() => instantiate(builder1, { imp: { memory: i0.exports.memory } }), WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte 35 / 41: there can at most be one Memory section for now`); +assert.throws(() => instantiate(builder1, { imp: { memory: i0.exports.memory } }), WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte 35: there can at most be one Memory section for now`); diff --git a/implementation-contributed/javascriptcore/wasm/function-tests/void-argument-type-should-be-a-validation-error.js b/implementation-contributed/javascriptcore/wasm/function-tests/void-argument-type-should-be-a-validation-error.js index 47149b1d7f..2178810a78 100644 --- a/implementation-contributed/javascriptcore/wasm/function-tests/void-argument-type-should-be-a-validation-error.js +++ b/implementation-contributed/javascriptcore/wasm/function-tests/void-argument-type-should-be-a-validation-error.js @@ -17,6 +17,6 @@ function getBinary(params) { return builder.WebAssembly().get(); } -assert.throws(() => new WebAssembly.Module(getBinary(["i32", "void"])), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 15 / 47: can't get 1th argument Type"); -assert.throws(() => new WebAssembly.Module(getBinary(["void"])), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 14 / 46: can't get 0th argument Type"); -assert.throws(() => new WebAssembly.Module(getBinary(["i32", "void", "i32"])), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 15 / 48: can't get 1th argument Type"); +assert.throws(() => new WebAssembly.Module(getBinary(["i32", "void"])), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 15: can't get 1th argument Type"); +assert.throws(() => new WebAssembly.Module(getBinary(["void"])), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 14: can't get 0th argument Type"); +assert.throws(() => new WebAssembly.Module(getBinary(["i32", "void", "i32"])), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 15: can't get 1th argument Type"); diff --git a/implementation-contributed/javascriptcore/wasm/js-api/Module-compile.js b/implementation-contributed/javascriptcore/wasm/js-api/Module-compile.js index d3beb33257..d723bf4d70 100644 --- a/implementation-contributed/javascriptcore/wasm/js-api/Module-compile.js +++ b/implementation-contributed/javascriptcore/wasm/js-api/Module-compile.js @@ -21,7 +21,7 @@ async function testPromiseAPI() { await WebAssembly.compile(builder.WebAssembly().get()); } catch(e) { assert.truthy(e instanceof WebAssembly.CompileError); - assert.truthy(e.message === "WebAssembly.Module doesn't parse at byte 34 / 43: there can at most be one Memory section for now"); + assert.truthy(e.message === "WebAssembly.Module doesn't parse at byte 34: there can at most be one Memory section for now"); } } diff --git a/implementation-contributed/javascriptcore/wasm/js-api/element.js b/implementation-contributed/javascriptcore/wasm/js-api/element.js index 188ac74151..fcbe2827f3 100644 --- a/implementation-contributed/javascriptcore/wasm/js-api/element.js +++ b/implementation-contributed/javascriptcore/wasm/js-api/element.js @@ -18,7 +18,7 @@ import * as assert from '../assert.js'; .End() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 24 / 41: Element section for Table 0 exceeds available Table 0"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 24: Element section for Table 0 exceeds available Table 0"); } { @@ -41,7 +41,7 @@ import * as assert from '../assert.js'; .End() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 30 / 47: Element section for Table 1 exceeds available Table 1"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 30: Element section for Table 1 exceeds available Table 1"); } { @@ -112,7 +112,7 @@ import * as assert from '../assert.js'; .End() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 38 / 50: Element section's 0th element's 2th index is 1 which exceeds the function index space size of 1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 38: Element section's 0th element's 2th index is 1 which exceeds the function index space size of 1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"); } { @@ -215,5 +215,5 @@ import * as assert from '../assert.js'; return new WebAssembly.Module(bin); } - assert.throws(() => badModule(), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 58 / 72: Element init_expr must produce an i32"); + assert.throws(() => badModule(), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 58: Element init_expr must produce an i32"); } diff --git a/implementation-contributed/javascriptcore/wasm/js-api/global-error.js b/implementation-contributed/javascriptcore/wasm/js-api/global-error.js index 09f8d799dc..d3edf898e7 100644 --- a/implementation-contributed/javascriptcore/wasm/js-api/global-error.js +++ b/implementation-contributed/javascriptcore/wasm/js-api/global-error.js @@ -23,7 +23,7 @@ import Builder from '../Builder.js'; const bin = builder.WebAssembly(); bin.trim(); - assert.throws(() => new WebAssembly.Module(bin.get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 26 / 59: get_global's index 0 exceeds the number of globals 0 (evaluating 'new WebAssembly.Module(bin.get())')"); + assert.throws(() => new WebAssembly.Module(bin.get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 26: get_global's index 0 exceeds the number of globals 0 (evaluating 'new WebAssembly.Module(bin.get())')"); } @@ -52,7 +52,7 @@ import Builder from '../Builder.js'; const bin = builder.WebAssembly(); bin.trim(); - assert.throws(() => new WebAssembly.Module(bin.get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 32 / 76: Mutable Globals aren't supported (evaluating 'new WebAssembly.Module(bin.get())')"); + assert.throws(() => new WebAssembly.Module(bin.get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 32: Mutable Globals aren't supported (evaluating 'new WebAssembly.Module(bin.get())')"); } { @@ -77,7 +77,7 @@ import Builder from '../Builder.js'; const bin = builder.WebAssembly(); bin.trim(); - assert.throws(() => new WebAssembly.Module(bin.get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 51 / 59: 1th Export isn't immutable, named 'global' (evaluating 'new WebAssembly.Module(bin.get())')"); + assert.throws(() => new WebAssembly.Module(bin.get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 51: 1th Export isn't immutable, named 'global' (evaluating 'new WebAssembly.Module(bin.get())')"); } { diff --git a/implementation-contributed/javascriptcore/wasm/js-api/test_Data.js b/implementation-contributed/javascriptcore/wasm/js-api/test_Data.js index cca0cf3bc4..4171435128 100644 --- a/implementation-contributed/javascriptcore/wasm/js-api/test_Data.js +++ b/implementation-contributed/javascriptcore/wasm/js-api/test_Data.js @@ -52,7 +52,7 @@ const assertMemoryAllZero = memory => { .Segment([0xff]).Offset(0).End() .End(); const bin = builder.WebAssembly().get(); - assert.throws(() => new WebAssembly.Module(bin), WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte 15 / 20: 0th Data segment has index 0 which exceeds the number of Memories 0`); + assert.throws(() => new WebAssembly.Module(bin), WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte 15: 0th Data segment has index 0 which exceeds the number of Memories 0`); })(); (function EmptyDataSectionWithoutMemory() { @@ -62,7 +62,7 @@ const assertMemoryAllZero = memory => { .Segment([]).Offset(0).End() .End(); const bin = builder.WebAssembly().get(); - assert.throws(() => new WebAssembly.Module(bin), WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte 15 / 19: 0th Data segment has index 0 which exceeds the number of Memories 0`); + assert.throws(() => new WebAssembly.Module(bin), WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte 15: 0th Data segment has index 0 which exceeds the number of Memories 0`); })(); (function DataSectionBiggerThanMemory() { diff --git a/implementation-contributed/javascriptcore/wasm/js-api/test_Start.js b/implementation-contributed/javascriptcore/wasm/js-api/test_Start.js index b44456932d..5c3150e1ca 100644 --- a/implementation-contributed/javascriptcore/wasm/js-api/test_Start.js +++ b/implementation-contributed/javascriptcore/wasm/js-api/test_Start.js @@ -31,5 +31,5 @@ import Builder from '../Builder.js'; .Start(0).End() // Invalid index. .Code().End(); const bin = b.WebAssembly().get(); - assert.throws(() => new WebAssembly.Module(bin), Error, `WebAssembly.Module doesn't parse at byte 17 / 20: Start index 0 exceeds function index space 0 (evaluating 'new WebAssembly.Module(bin)')`); + assert.throws(() => new WebAssembly.Module(bin), Error, `WebAssembly.Module doesn't parse at byte 17: Start index 0 exceeds function index space 0 (evaluating 'new WebAssembly.Module(bin)')`); })(); diff --git a/implementation-contributed/javascriptcore/wasm/js-api/test_basic_api.js b/implementation-contributed/javascriptcore/wasm/js-api/test_basic_api.js index 08e74aa324..1a2d222103 100644 --- a/implementation-contributed/javascriptcore/wasm/js-api/test_basic_api.js +++ b/implementation-contributed/javascriptcore/wasm/js-api/test_basic_api.js @@ -67,7 +67,7 @@ for (const c in constructorProperties) { assert.throws(() => new WebAssembly[c](invalid), TypeError, `first argument must be an ArrayBufferView or an ArrayBuffer (evaluating 'new WebAssembly[c](invalid)')`); for (const buffer of [new ArrayBuffer(), new DataView(new ArrayBuffer()), new Int8Array(), new Uint8Array(), new Uint8ClampedArray(), new Int16Array(), new Uint16Array(), new Int32Array(), new Uint32Array(), new Float32Array(), new Float64Array()]) // FIXME the following should be WebAssembly.CompileError. https://bugs.webkit.org/show_bug.cgi?id=163768 - assert.throws(() => new WebAssembly[c](buffer), Error, `WebAssembly.Module doesn't parse at byte 0 / 0: expected a module of at least 8 bytes (evaluating 'new WebAssembly[c](buffer)')`); + assert.throws(() => new WebAssembly[c](buffer), Error, `WebAssembly.Module doesn't parse at byte 0: expected a module of at least 8 bytes (evaluating 'new WebAssembly[c](buffer)')`); assert.instanceof(new WebAssembly[c](emptyModuleArray), WebAssembly.Module); break; case "Instance": diff --git a/implementation-contributed/javascriptcore/wasm/js-api/version.js b/implementation-contributed/javascriptcore/wasm/js-api/version.js index 81cd7ff012..0486fcfdde 100644 --- a/implementation-contributed/javascriptcore/wasm/js-api/version.js +++ b/implementation-contributed/javascriptcore/wasm/js-api/version.js @@ -5,5 +5,5 @@ for (let version = 0; version < 256; ++version) { if (version === 1) continue; const emptyModuleArray = Uint8Array.of(0x0, 0x61, 0x73, 0x6d, version, 0x00, 0x00, 0x00); - assert.throws(() => new WebAssembly.Module(emptyModuleArray), WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte 8 / 8: unexpected version number ${version} expected 1`); + assert.throws(() => new WebAssembly.Module(emptyModuleArray), WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte 8: unexpected version number ${version} expected 1`); }