mirror of https://github.com/tc39/test262.git
[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)
This commit is contained in:
parent
835c85c26e
commit
eaa48b4f00
|
@ -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'");
|
||||
}
|
||||
|
|
|
@ -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`);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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`);
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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())')");
|
||||
}
|
||||
|
||||
{
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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)')`);
|
||||
})();
|
||||
|
|
|
@ -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":
|
||||
|
|
|
@ -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`);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue