From dbc101606b6044c0d769c4116370ba8da21e9502 Mon Sep 17 00:00:00 2001 From: test262-automation <40212386+test262-automation@users.noreply.github.com> Date: Fri, 31 Aug 2018 14:46:07 -0400 Subject: [PATCH] Import test changes from JavaScriptCore (#1698) * [javascriptcore-test262-automation] Changes from https://github.com/webkit/webkit.git at sha 8a25978f29 on Tue Aug 28 2018 18:16:05 GMT+0000 (Coordinated Universal Time) * [javascriptcore-test262-automation] Updated curation log with latest revision sha's from export and changed files. sourceRevisionAtLastExport: 8a25978f29 targetRevisionAtLastExport: 70dc33467 --- .../curation_logs/javascriptcore.json | 4 +- .../javascriptcore/stress/regress-188577.js | 20 ++++++ .../invalid-duplicate-export.js | 2 +- .../wasm/function-tests/memory-alignment.js | 2 +- .../memory-section-and-import.js | 2 +- ...ument-type-should-be-a-validation-error.js | 6 +- .../wasm/js-api/Module-compile.js | 2 +- .../javascriptcore/wasm/js-api/element.js | 8 +-- .../wasm/js-api/global-error.js | 6 +- .../javascriptcore/wasm/js-api/table.js | 62 +++++++++--------- .../javascriptcore/wasm/js-api/test_Data.js | 4 +- .../javascriptcore/wasm/js-api/test_Start.js | 2 +- .../wasm/js-api/test_basic_api.js | 2 +- .../javascriptcore/wasm/js-api/version.js | 2 +- .../wasm/stress/nameSection.wasm | Bin 0 -> 13409 bytes .../wasm/stress/streaming-basic.js | 18 +++++ 16 files changed, 90 insertions(+), 52 deletions(-) create mode 100644 implementation-contributed/javascriptcore/stress/regress-188577.js create mode 100644 implementation-contributed/javascriptcore/wasm/stress/nameSection.wasm create mode 100644 implementation-contributed/javascriptcore/wasm/stress/streaming-basic.js diff --git a/implementation-contributed/curation_logs/javascriptcore.json b/implementation-contributed/curation_logs/javascriptcore.json index 7e1e764236..10b448f922 100644 --- a/implementation-contributed/curation_logs/javascriptcore.json +++ b/implementation-contributed/curation_logs/javascriptcore.json @@ -1,6 +1,6 @@ { - "sourceRevisionAtLastExport": "8a25978f29", - "targetRevisionAtLastExport": "70dc33467", + "sourceRevisionAtLastExport": "671be37db3", + "targetRevisionAtLastExport": "eaa48b4f0", "curatedFiles": { "/stress/Number-isNaN-basics.js": "DELETED_IN_TARGET", "/stress/Object_static_methods_Object.getOwnPropertyDescriptors-proxy.js": "DELETED_IN_TARGET", diff --git a/implementation-contributed/javascriptcore/stress/regress-188577.js b/implementation-contributed/javascriptcore/stress/regress-188577.js new file mode 100644 index 0000000000..46b87511b0 --- /dev/null +++ b/implementation-contributed/javascriptcore/stress/regress-188577.js @@ -0,0 +1,20 @@ +//@ requireOptions("--maxPerThreadStackUsage=262144") + +var exception; +try { + var i = 25000; + var args = []; + var v3; + while (i--) + args[i] = "a"; + var argsList = args.join(); + setter = Function(argsList, ""); + Object.defineProperty(args, '0', {set: setter}); + args.sort(); + +} catch (e) { + exception = e; +} + +if (exception != "RangeError: Maximum call stack size exceeded.") + throw "FAILED"; 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/table.js b/implementation-contributed/javascriptcore/wasm/js-api/table.js index b832e11766..cf68b44049 100644 --- a/implementation-contributed/javascriptcore/wasm/js-api/table.js +++ b/implementation-contributed/javascriptcore/wasm/js-api/table.js @@ -13,7 +13,7 @@ import * as assert from '../assert.js'; .End() .Code() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 34 / 41: Cannot have more than one Table for now"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 34: Cannot have more than one Table for now"); } { @@ -38,7 +38,7 @@ import * as assert from '../assert.js'; .End() .Code() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 17 / 28: Table count of 2 is invalid, at most 1 is allowed for now (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 17: Table count of 2 is invalid, at most 1 is allowed for now (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"); } { @@ -54,7 +54,7 @@ import * as assert from '../assert.js'; .CallIndirect(0, 0) .End() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 4 / 7: call_indirect is only valid when a table is defined or imported, in function at index 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 4: call_indirect is only valid when a table is defined or imported, in function at index 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"); } { @@ -73,7 +73,7 @@ import * as assert from '../assert.js'; .CallIndirect(0, 1) .End() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 6 / 7: call_indirect's 'reserved' varuint1 must be 0x0, in function at index 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 6: call_indirect's 'reserved' varuint1 must be 0x0, in function at index 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"); } { @@ -86,7 +86,7 @@ import * as assert from '../assert.js'; .End() .Code() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 23 / 26: can't export Table 0 there are 0 Tables"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 23: can't export Table 0 there are 0 Tables"); } { @@ -102,7 +102,7 @@ import * as assert from '../assert.js'; .End() .Code() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 30 / 33: can't export Table 1 there are 1 Tables"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 30: can't export Table 1 there are 1 Tables"); } function assertBadTable(tableDescription, message) { @@ -132,42 +132,42 @@ function assertBadTableImport(tableDescription, message) { { let badDescriptions = [ [{initial: 10, element: "i32"}, - "WebAssembly.Module doesn't parse at byte 18 / 23: Table type should be anyfunc, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 26 / 34: Table type should be anyfunc, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 10, element: "f32"}, - "WebAssembly.Module doesn't parse at byte 18 / 23: Table type should be anyfunc, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 26 / 34: Table type should be anyfunc, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 10, element: "f64"}, - "WebAssembly.Module doesn't parse at byte 18 / 23: Table type should be anyfunc, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 26 / 34: Table type should be anyfunc, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 10, element: "i64"}, - "WebAssembly.Module doesn't parse at byte 18 / 23: Table type should be anyfunc, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 26 / 34: Table type should be anyfunc, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 10, maximum: 20, element: "i32"}, - "WebAssembly.Module doesn't parse at byte 18 / 24: Table type should be anyfunc, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 26 / 35: Table type should be anyfunc, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 10, maximum: 20, element: "f32"}, - "WebAssembly.Module doesn't parse at byte 18 / 24: Table type should be anyfunc, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 26 / 35: Table type should be anyfunc, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 10, maximum: 20, element: "f64"}, - "WebAssembly.Module doesn't parse at byte 18 / 24: Table type should be anyfunc, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 26 / 35: Table type should be anyfunc, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 10, maximum: 20, element: "i64"}, - "WebAssembly.Module doesn't parse at byte 18 / 24: Table type should be anyfunc, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 26 / 35: Table type should be anyfunc, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 10, maximum: 9, element: "anyfunc"}, - "WebAssembly.Module doesn't parse at byte 21 / 24: resizable limits has a initial page count of 10 which is greater than its maximum 9 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 29 / 35: resizable limits has a initial page count of 10 which is greater than its maximum 9 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 21: resizable limits has a initial page count of 10 which is greater than its maximum 9 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 29: resizable limits has a initial page count of 10 which is greater than its maximum 9 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 1, maximum: 0, element: "anyfunc"}, - "WebAssembly.Module doesn't parse at byte 21 / 24: resizable limits has a initial page count of 1 which is greater than its maximum 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 29 / 35: resizable limits has a initial page count of 1 which is greater than its maximum 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 21: resizable limits has a initial page count of 1 which is greater than its maximum 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 29: resizable limits has a initial page count of 1 which is greater than its maximum 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 2**32 - 1, maximum: 2**32 - 2, element: "anyfunc"}, - "WebAssembly.Module doesn't parse at byte 29 / 32: resizable limits has a initial page count of 4294967295 which is greater than its maximum 4294967294 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 37 / 43: resizable limits has a initial page count of 4294967295 which is greater than its maximum 4294967294 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 29: resizable limits has a initial page count of 4294967295 which is greater than its maximum 4294967294 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 37: resizable limits has a initial page count of 4294967295 which is greater than its maximum 4294967294 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 2**31, element: "anyfunc"}, - "WebAssembly.Module doesn't parse at byte 24 / 27: Table's initial page count of 2147483648 is too big, maximum 10000000 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 32 / 38: Table's initial page count of 2147483648 is too big, maximum 10000000 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 24: Table's initial page count of 2147483648 is too big, maximum 10000000 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 32: Table's initial page count of 2147483648 is too big, maximum 10000000 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], ]; for (const d of badDescriptions) { @@ -186,7 +186,7 @@ function assertBadTableImport(tableDescription, message) { .Function().End() .Code() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 39 / 48: Cannot have more than one Table for now"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 39: Cannot have more than one Table for now"); } 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`); } diff --git a/implementation-contributed/javascriptcore/wasm/stress/nameSection.wasm b/implementation-contributed/javascriptcore/wasm/stress/nameSection.wasm new file mode 100644 index 0000000000000000000000000000000000000000..24b22b1aeea38e469c3260ba34d5da4a6db12153 GIT binary patch literal 13409 zcmbW8ON?AudB@LvRaMum>MoCM=$Y~0d#?=`Fwg^oK_jI2gxG^IW(YG2vZ`r&Y6e%g z-R|ld!$>IIA&`s|qC~Jk(d4l}1d%LQBoYfGtURPdV!<MjSfGeSB1OuE#YD=2Wb*re z=iYjB_e=ug>AJ6T&-vcp|NHK}ZgcNW<eZEC;^5%Gb)HN1_xGdy=OX>Y`}>YP_nhOv zIUTc;GJ<XVrQha;)5+-W{ncOljZgU-*FN^_)1MxG`q|GU`%Y&&&phitcAaze@roS} zZ}`vFC$i0(JCmtPG`K&yyS+JiadcyJXJ_)VOKsX0N7H9_rkmS~C*Nu}J$?6Mn|JT- zOrM(Ue17rjTZW@Md$%UH?@dQ{hj&JIZryu%c=Ps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qk554!LzMYQ}GMZCKF1x4~kA5Wxj@ZCh#d@|9hzm{k(ekjpd{6=DB z>C=XdZvACMzVuN<Z~i?*e`)-s)rFV(*XExI43^&DKXKew1rN=>064k$3BswxuNF>c z!_kW`?!Bcoyt#R6=k8ni;^5xqo%QB}frsDh%Y#Q&_07ig`P)0gTiZK(qeth*pP$^G zj?Ne(c71O&+Iq|`htEWYlhO2TM?X3^dy*ONP5EeH^Lf5H*?wX8_{Il|{?e(kJAD47 zJ9l0le(1v+)morn=cVb;mOLlH>!XqvZf}pyYyI$zi4NbcYdbIS)dbhyp=&w_*WcNE zyK&(m&WF!9>Pw^N-_?BZ@$T^T#CsM$@3<Jg(Rgq3(Z>6luQA@g@cqQb(&rP8$2T`V J5Z`?Ke*s81TjBr! literal 0 HcmV?d00001 diff --git a/implementation-contributed/javascriptcore/wasm/stress/streaming-basic.js b/implementation-contributed/javascriptcore/wasm/stress/streaming-basic.js new file mode 100644 index 0000000000..b3fbc2479f --- /dev/null +++ b/implementation-contributed/javascriptcore/wasm/stress/streaming-basic.js @@ -0,0 +1,18 @@ +import * as assert from '../assert.js'; + +var data = read("./nameSection.wasm", "binary"); + +function check(step) +{ + var parser = $vm.createWasmStreamingParser(); + for (var i = 0; i < data.byteLength; i += step) { + parser.addBytes(data.subarray(i, i + Math.min(step, data.byteLength - i))); + } + assert.eq(parser.finalize(), 7); +} + +for (var i = 0; i < 10; ++i) + check(i + 1); +check(100); +check(1000); +check(2000); -- GitLab