diff --git a/implementation-contributed/javascriptcore/stress/regress-189185.js b/implementation-contributed/javascriptcore/stress/regress-189185.js index d67f9d41b2..c016efd268 100644 --- a/implementation-contributed/javascriptcore/stress/regress-189185.js +++ b/implementation-contributed/javascriptcore/stress/regress-189185.js @@ -1,4 +1,5 @@ //@ runDefault +//@ skip if $architecture == "x86" // This passes if it does not crash. new WebAssembly.CompileError({ valueOf() { diff --git a/implementation-contributed/javascriptcore/stress/regress-189292.js b/implementation-contributed/javascriptcore/stress/regress-189292.js new file mode 100644 index 0000000000..4314f9abe3 --- /dev/null +++ b/implementation-contributed/javascriptcore/stress/regress-189292.js @@ -0,0 +1,18 @@ +//@ runDefault + +function assert(a, b) { + if (a != b) + throw "FAIL"; +} + +function test(script) { + try { + eval(script); + } catch (e) { + return e; + } +} + +assert(test("class C1 { async constructor() { } }"), "SyntaxError: Cannot declare an async method named 'constructor'."); +assert(test("class C1 { *constructor() { } }"), "SyntaxError: Cannot declare a generator function named 'constructor'."); +assert(test("class C1 { async *constructor() { } }"), "SyntaxError: Cannot declare an async generator method named 'constructor'.");