diff options
Diffstat (limited to 'deps/v8/test/message/fail')
53 files changed, 188 insertions, 60 deletions
diff --git a/deps/v8/test/message/fail/class-field-constructor.js b/deps/v8/test/message/fail/class-field-constructor.js index baeb04e94d..4c6f42d0f2 100644 --- a/deps/v8/test/message/fail/class-field-constructor.js +++ b/deps/v8/test/message/fail/class-field-constructor.js @@ -1,8 +1,6 @@ // Copyright 2015 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// -// Flags: --harmony-public-fields class X { constructor = function() {}; diff --git a/deps/v8/test/message/fail/class-field-constructor.out b/deps/v8/test/message/fail/class-field-constructor.out index 51f26957ad..29c0588100 100644 --- a/deps/v8/test/message/fail/class-field-constructor.out +++ b/deps/v8/test/message/fail/class-field-constructor.out @@ -1,4 +1,4 @@ -*%(basename)s:8: SyntaxError: Classes may not have a field named 'constructor' +*%(basename)s:6: SyntaxError: Classes may not have a field named 'constructor' constructor = function() {}; ^^^^^^^^^^^ SyntaxError: Classes may not have a field named 'constructor'
\ No newline at end of file diff --git a/deps/v8/test/message/fail/class-field-static-constructor.js b/deps/v8/test/message/fail/class-field-static-constructor.js index 63ce1c04d7..d01be68c21 100644 --- a/deps/v8/test/message/fail/class-field-static-constructor.js +++ b/deps/v8/test/message/fail/class-field-static-constructor.js @@ -1,8 +1,6 @@ // Copyright 2015 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// -// Flags: --harmony-public-fields --harmony-static-fields class X { static constructor = function() {}; diff --git a/deps/v8/test/message/fail/class-field-static-constructor.out b/deps/v8/test/message/fail/class-field-static-constructor.out index 6831d83552..7f330b7bc0 100644 --- a/deps/v8/test/message/fail/class-field-static-constructor.out +++ b/deps/v8/test/message/fail/class-field-static-constructor.out @@ -1,4 +1,4 @@ -*%(basename)s:8: SyntaxError: Classes may not have a field named 'constructor' +*%(basename)s:6: SyntaxError: Classes may not have a field named 'constructor' static constructor = function() {}; ^^^^^^^^^^^ SyntaxError: Classes may not have a field named 'constructor'
\ No newline at end of file diff --git a/deps/v8/test/message/fail/class-field-static-prototype.js b/deps/v8/test/message/fail/class-field-static-prototype.js index 656518879a..299d2aa041 100644 --- a/deps/v8/test/message/fail/class-field-static-prototype.js +++ b/deps/v8/test/message/fail/class-field-static-prototype.js @@ -1,8 +1,6 @@ // Copyright 2015 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// -// Flags: --harmony-public-fields --harmony-static-fields class X { static prototype = function() {}; diff --git a/deps/v8/test/message/fail/class-field-static-prototype.out b/deps/v8/test/message/fail/class-field-static-prototype.out index 06d6a75842..767a78e5ff 100644 --- a/deps/v8/test/message/fail/class-field-static-prototype.out +++ b/deps/v8/test/message/fail/class-field-static-prototype.out @@ -1,4 +1,4 @@ -*%(basename)s:8: SyntaxError: Classes may not have a static property named 'prototype' +*%(basename)s:6: SyntaxError: Classes may not have a static property named 'prototype' static prototype = function() {}; ^^^^^^^^^ SyntaxError: Classes may not have a static property named 'prototype'
\ No newline at end of file diff --git a/deps/v8/test/message/fail/class-fields-computed.js b/deps/v8/test/message/fail/class-fields-computed.js index d9b41906ab..22a5981978 100644 --- a/deps/v8/test/message/fail/class-fields-computed.js +++ b/deps/v8/test/message/fail/class-fields-computed.js @@ -1,8 +1,6 @@ // Copyright 2018 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// -// Flags: --harmony-public-fields class X { [foo()] = 1; diff --git a/deps/v8/test/message/fail/class-fields-computed.out b/deps/v8/test/message/fail/class-fields-computed.out index 214b273af5..bc4ccdb7e3 100644 --- a/deps/v8/test/message/fail/class-fields-computed.out +++ b/deps/v8/test/message/fail/class-fields-computed.out @@ -1,5 +1,5 @@ -*%(basename)s:8: ReferenceError: foo is not defined +*%(basename)s:6: ReferenceError: foo is not defined [foo()] = 1; ^ ReferenceError: foo is not defined - at *%(basename)s:8:4
\ No newline at end of file + at *%(basename)s:6:4
\ No newline at end of file diff --git a/deps/v8/test/message/fail/class-fields-private-class-in-function.js b/deps/v8/test/message/fail/class-fields-private-class-in-function.js index 215e083962..946cc90a6a 100644 --- a/deps/v8/test/message/fail/class-fields-private-class-in-function.js +++ b/deps/v8/test/message/fail/class-fields-private-class-in-function.js @@ -1,8 +1,6 @@ // Copyright 2019 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// -// Flags: --harmony-private-fields class Y { makeClass() { diff --git a/deps/v8/test/message/fail/class-fields-private-class-in-function.out b/deps/v8/test/message/fail/class-fields-private-class-in-function.out index 1e564497c5..3d07d644d8 100644 --- a/deps/v8/test/message/fail/class-fields-private-class-in-function.out +++ b/deps/v8/test/message/fail/class-fields-private-class-in-function.out @@ -1,4 +1,4 @@ -*%(basename)s:12: SyntaxError: Undefined private field #b: must be declared in an enclosing class +*%(basename)s:10: SyntaxError: Private field '#b' must be declared in an enclosing class getB() { return this.#b; } ^ -SyntaxError: Undefined private field #b: must be declared in an enclosing class +SyntaxError: Private field '#b' must be declared in an enclosing class diff --git a/deps/v8/test/message/fail/class-fields-private-outside-class.js b/deps/v8/test/message/fail/class-fields-private-outside-class.js new file mode 100644 index 0000000000..cacb90a33c --- /dev/null +++ b/deps/v8/test/message/fail/class-fields-private-outside-class.js @@ -0,0 +1,6 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +class Foo { #x = 42; } +new Foo().#x; diff --git a/deps/v8/test/message/fail/class-fields-private-outside-class.out b/deps/v8/test/message/fail/class-fields-private-outside-class.out new file mode 100644 index 0000000000..34919122fc --- /dev/null +++ b/deps/v8/test/message/fail/class-fields-private-outside-class.out @@ -0,0 +1,4 @@ +*%(basename)s:6: SyntaxError: Private field '#x' must be declared in an enclosing class +new Foo().#x; + ^ +SyntaxError: Private field '#x' must be declared in an enclosing class
\ No newline at end of file diff --git a/deps/v8/test/message/fail/class-fields-private-source-positions.js b/deps/v8/test/message/fail/class-fields-private-source-positions.js index b4f8093a1f..d3b9cbdafa 100644 --- a/deps/v8/test/message/fail/class-fields-private-source-positions.js +++ b/deps/v8/test/message/fail/class-fields-private-source-positions.js @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Flags: --harmony-private-fields - var o = {}; class C { #a = 0; diff --git a/deps/v8/test/message/fail/class-fields-private-source-positions.out b/deps/v8/test/message/fail/class-fields-private-source-positions.out index cc70fde7b6..7c2f99964b 100644 --- a/deps/v8/test/message/fail/class-fields-private-source-positions.out +++ b/deps/v8/test/message/fail/class-fields-private-source-positions.out @@ -1,5 +1,5 @@ -*%(basename)s:11: TypeError: Read of private field #a from an object which did not contain the field +*%(basename)s:9: TypeError: Read of private field #a from an object which did not contain the field [o.#a](){} ^ TypeError: Read of private field #a from an object which did not contain the field - at *%(basename)s:11:8 + at *%(basename)s:9:8 diff --git a/deps/v8/test/message/fail/class-fields-private-throw-early-2.js b/deps/v8/test/message/fail/class-fields-private-throw-early-2.js index 2831d4d91a..9ec86caafe 100644 --- a/deps/v8/test/message/fail/class-fields-private-throw-early-2.js +++ b/deps/v8/test/message/fail/class-fields-private-throw-early-2.js @@ -1,8 +1,6 @@ // Copyright 2018 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// -// Flags: --harmony-private-fields class X { #x; diff --git a/deps/v8/test/message/fail/class-fields-private-throw-early-2.out b/deps/v8/test/message/fail/class-fields-private-throw-early-2.out index fdcdfbd414..1cf7bb41ae 100644 --- a/deps/v8/test/message/fail/class-fields-private-throw-early-2.out +++ b/deps/v8/test/message/fail/class-fields-private-throw-early-2.out @@ -1,6 +1,6 @@ -*%(basename)s:10: TypeError: Write of private field #x to an object which did not contain the field +*%(basename)s:8: TypeError: Write of private field #x to an object which did not contain the field ({}).#x = 1; ^ TypeError: Write of private field #x to an object which did not contain the field - at new X (*%(basename)s:10:13) - at *%(basename)s:14:1
\ No newline at end of file + at new X (*%(basename)s:8:13) + at *%(basename)s:12:1
\ No newline at end of file diff --git a/deps/v8/test/message/fail/class-fields-private-throw-early.js b/deps/v8/test/message/fail/class-fields-private-throw-early.js index b224a8d04e..e0b2501ad0 100644 --- a/deps/v8/test/message/fail/class-fields-private-throw-early.js +++ b/deps/v8/test/message/fail/class-fields-private-throw-early.js @@ -1,8 +1,6 @@ // Copyright 2018 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// -// Flags: --harmony-private-fields class X { constructor() { diff --git a/deps/v8/test/message/fail/class-fields-private-throw-early.out b/deps/v8/test/message/fail/class-fields-private-throw-early.out index 86395a2ee5..7fa9da0951 100644 --- a/deps/v8/test/message/fail/class-fields-private-throw-early.out +++ b/deps/v8/test/message/fail/class-fields-private-throw-early.out @@ -1,4 +1,4 @@ -*%(basename)s:9: SyntaxError: Undefined private field #x: must be declared in an enclosing class +*%(basename)s:7: SyntaxError: Private field '#x' must be declared in an enclosing class this.#x = 1; ^ -SyntaxError: Undefined private field #x: must be declared in an enclosing class
\ No newline at end of file +SyntaxError: Private field '#x' must be declared in an enclosing class
\ No newline at end of file diff --git a/deps/v8/test/message/fail/class-fields-private-throw-in-module.js b/deps/v8/test/message/fail/class-fields-private-throw-in-module.js index 4b90436f46..5e75c72086 100644 --- a/deps/v8/test/message/fail/class-fields-private-throw-in-module.js +++ b/deps/v8/test/message/fail/class-fields-private-throw-in-module.js @@ -3,7 +3,6 @@ // found in the LICENSE file. // // MODULE -// Flags: --harmony-private-fields class X { constructor() { diff --git a/deps/v8/test/message/fail/class-fields-private-throw-in-module.out b/deps/v8/test/message/fail/class-fields-private-throw-in-module.out index e63207a815..2c0df1acef 100644 --- a/deps/v8/test/message/fail/class-fields-private-throw-in-module.out +++ b/deps/v8/test/message/fail/class-fields-private-throw-in-module.out @@ -1,4 +1,4 @@ -*%(basename)s:10: SyntaxError: Undefined private field #x: must be declared in an enclosing class +*%(basename)s:9: SyntaxError: Private field '#x' must be declared in an enclosing class this.#x = 1; ^ -SyntaxError: Undefined private field #x: must be declared in an enclosing class
\ No newline at end of file +SyntaxError: Private field '#x' must be declared in an enclosing class
\ No newline at end of file diff --git a/deps/v8/test/message/fail/class-fields-private-throw-read.js b/deps/v8/test/message/fail/class-fields-private-throw-read.js index 3be60efdfc..b04353395d 100644 --- a/deps/v8/test/message/fail/class-fields-private-throw-read.js +++ b/deps/v8/test/message/fail/class-fields-private-throw-read.js @@ -1,8 +1,6 @@ // Copyright 2018 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// -// Flags: --harmony-private-fields class X { #x; diff --git a/deps/v8/test/message/fail/class-fields-private-throw-read.out b/deps/v8/test/message/fail/class-fields-private-throw-read.out index 4b49cfd354..ec8dcf5108 100644 --- a/deps/v8/test/message/fail/class-fields-private-throw-read.out +++ b/deps/v8/test/message/fail/class-fields-private-throw-read.out @@ -1,6 +1,6 @@ -*%(basename)s:9: TypeError: Read of private field #x from an object which did not contain the field +*%(basename)s:7: TypeError: Read of private field #x from an object which did not contain the field eq(o) { return this.#x === o.#x; } ^ TypeError: Read of private field #x from an object which did not contain the field - at X.eq (*%(basename)s:9:32) - at *%(basename)s:12:9
\ No newline at end of file + at X.eq (*%(basename)s:7:32) + at *%(basename)s:10:9
\ No newline at end of file diff --git a/deps/v8/test/message/fail/class-fields-private-throw-write.js b/deps/v8/test/message/fail/class-fields-private-throw-write.js index 93e9c135b9..1c51b1a6fd 100644 --- a/deps/v8/test/message/fail/class-fields-private-throw-write.js +++ b/deps/v8/test/message/fail/class-fields-private-throw-write.js @@ -1,8 +1,6 @@ // Copyright 2018 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// -// Flags: --harmony-private-fields class X { #x; diff --git a/deps/v8/test/message/fail/class-fields-private-throw-write.out b/deps/v8/test/message/fail/class-fields-private-throw-write.out index e0a11d90bc..8d9047cc62 100644 --- a/deps/v8/test/message/fail/class-fields-private-throw-write.out +++ b/deps/v8/test/message/fail/class-fields-private-throw-write.out @@ -1,6 +1,6 @@ -*%(basename)s:9: TypeError: Write of private field #x to an object which did not contain the field +*%(basename)s:7: TypeError: Write of private field #x to an object which did not contain the field setX(o, val) { o.#x = val; } ^ TypeError: Write of private field #x to an object which did not contain the field - at X.setX (*%(basename)s:9:23) - at *%(basename)s:12:9
\ No newline at end of file + at X.setX (*%(basename)s:7:23) + at *%(basename)s:10:9
\ No newline at end of file diff --git a/deps/v8/test/message/fail/class-fields-private-undeclared-lazy-class.js b/deps/v8/test/message/fail/class-fields-private-undeclared-lazy-class.js new file mode 100644 index 0000000000..e6bccbfe2e --- /dev/null +++ b/deps/v8/test/message/fail/class-fields-private-undeclared-lazy-class.js @@ -0,0 +1,13 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +function x() { + class Foo { + constructor () { + class Bar { + x = this.#foo; + } + } + } +} diff --git a/deps/v8/test/message/fail/class-fields-private-undeclared-lazy-class.out b/deps/v8/test/message/fail/class-fields-private-undeclared-lazy-class.out new file mode 100644 index 0000000000..556e432ab1 --- /dev/null +++ b/deps/v8/test/message/fail/class-fields-private-undeclared-lazy-class.out @@ -0,0 +1,4 @@ +*%(basename)s:9: SyntaxError: Private field '#foo' must be declared in an enclosing class + x = this.#foo; + ^ +SyntaxError: Private field '#foo' must be declared in an enclosing class
\ No newline at end of file diff --git a/deps/v8/test/message/fail/class-fields-private-undefined-inner-class.js b/deps/v8/test/message/fail/class-fields-private-undefined-inner-class.js index 1e115b61e7..c2c9f4da48 100644 --- a/deps/v8/test/message/fail/class-fields-private-undefined-inner-class.js +++ b/deps/v8/test/message/fail/class-fields-private-undefined-inner-class.js @@ -1,8 +1,6 @@ // Copyright 2019 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// -// Flags: --harmony-private-fields class A { fn() { diff --git a/deps/v8/test/message/fail/class-fields-private-undefined-inner-class.out b/deps/v8/test/message/fail/class-fields-private-undefined-inner-class.out index a2fb293968..ec3c8c308e 100644 --- a/deps/v8/test/message/fail/class-fields-private-undefined-inner-class.out +++ b/deps/v8/test/message/fail/class-fields-private-undefined-inner-class.out @@ -1,4 +1,4 @@ -*%(basename)s:10: SyntaxError: Undefined private field #b: must be declared in an enclosing class +*%(basename)s:8: SyntaxError: Private field '#b' must be declared in an enclosing class getA() { return this.#b; } ^ -SyntaxError: Undefined private field #b: must be declared in an enclosing class +SyntaxError: Private field '#b' must be declared in an enclosing class diff --git a/deps/v8/test/message/fail/class-fields-static-throw.js b/deps/v8/test/message/fail/class-fields-static-throw.js index e7c9fec1ba..5de3fa744b 100644 --- a/deps/v8/test/message/fail/class-fields-static-throw.js +++ b/deps/v8/test/message/fail/class-fields-static-throw.js @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // -// Flags: --harmony-public-fields --harmony-static-fields -// // TODO(gsathya): Remove 'Function' from stack trace. class X { diff --git a/deps/v8/test/message/fail/class-fields-static-throw.out b/deps/v8/test/message/fail/class-fields-static-throw.out index a16b050bbd..456d1f38c0 100644 --- a/deps/v8/test/message/fail/class-fields-static-throw.out +++ b/deps/v8/test/message/fail/class-fields-static-throw.out @@ -1,6 +1,6 @@ -*%(basename)s:10: ReferenceError: foo is not defined +*%(basename)s:8: ReferenceError: foo is not defined static x = foo(); ^ ReferenceError: foo is not defined - at Function.<static_fields_initializer> (*%(basename)s:10:14) + at Function.<static_fields_initializer> (*%(basename)s:8:14) at *%(basename)s:1:1
\ No newline at end of file diff --git a/deps/v8/test/message/fail/class-fields-throw.js b/deps/v8/test/message/fail/class-fields-throw.js index 235a964ae8..69194e677d 100644 --- a/deps/v8/test/message/fail/class-fields-throw.js +++ b/deps/v8/test/message/fail/class-fields-throw.js @@ -1,8 +1,6 @@ // Copyright 2018 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// -// Flags: --harmony-public-fields class X { x = foo(); diff --git a/deps/v8/test/message/fail/class-fields-throw.out b/deps/v8/test/message/fail/class-fields-throw.out index 3c347a9529..b7bce52a7f 100644 --- a/deps/v8/test/message/fail/class-fields-throw.out +++ b/deps/v8/test/message/fail/class-fields-throw.out @@ -1,7 +1,7 @@ -*%(basename)s:8: ReferenceError: foo is not defined +*%(basename)s:6: ReferenceError: foo is not defined x = foo(); ^ ReferenceError: foo is not defined - at X.<instance_members_initializer> (*%(basename)s:8:7) - at new X (*%(basename)s:7:1) - at *%(basename)s:11:1
\ No newline at end of file + at X.<instance_members_initializer> (*%(basename)s:6:7) + at new X (*%(basename)s:5:1) + at *%(basename)s:9:1
\ No newline at end of file diff --git a/deps/v8/test/message/fail/destructuring-object-private-name.js b/deps/v8/test/message/fail/destructuring-object-private-name.js index 3e30bd2321..aaf3244cb9 100644 --- a/deps/v8/test/message/fail/destructuring-object-private-name.js +++ b/deps/v8/test/message/fail/destructuring-object-private-name.js @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Flags: --harmony-class-fields - class Foo { #x = 1; destructureX() { diff --git a/deps/v8/test/message/fail/destructuring-object-private-name.out b/deps/v8/test/message/fail/destructuring-object-private-name.out index 83b6b8eb80..6a3ecd37c3 100644 --- a/deps/v8/test/message/fail/destructuring-object-private-name.out +++ b/deps/v8/test/message/fail/destructuring-object-private-name.out @@ -1,4 +1,4 @@ -*%(basename)s:10: SyntaxError: Unexpected identifier +*%(basename)s:8: SyntaxError: Unexpected identifier const { #x: x } = this; ^^ SyntaxError: Unexpected identifier diff --git a/deps/v8/test/message/fail/json-stringify-circular-ellipsis.out b/deps/v8/test/message/fail/json-stringify-circular-ellipsis.out index c288ee95ea..88414552f0 100644 --- a/deps/v8/test/message/fail/json-stringify-circular-ellipsis.out +++ b/deps/v8/test/message/fail/json-stringify-circular-ellipsis.out @@ -16,3 +16,4 @@ TypeError: Converting circular structure to JSON --- property 'y' closes the circle at JSON.stringify (<anonymous>) at *%(basename)s:27:6 + diff --git a/deps/v8/test/message/fail/json-stringify-circular-max-display-depth.out b/deps/v8/test/message/fail/json-stringify-circular-max-display-depth.out index bf81266dd5..388a7f2644 100644 --- a/deps/v8/test/message/fail/json-stringify-circular-max-display-depth.out +++ b/deps/v8/test/message/fail/json-stringify-circular-max-display-depth.out @@ -14,3 +14,4 @@ TypeError: Converting circular structure to JSON --- index 1 closes the circle at JSON.stringify (<anonymous>) at *%(basename)s:21:6 + diff --git a/deps/v8/test/message/fail/json-stringify-circular-proxy.out b/deps/v8/test/message/fail/json-stringify-circular-proxy.out index 6004cfb42d..b7abf8867a 100644 --- a/deps/v8/test/message/fail/json-stringify-circular-proxy.out +++ b/deps/v8/test/message/fail/json-stringify-circular-proxy.out @@ -16,3 +16,4 @@ TypeError: Converting circular structure to JSON --- property 'y' closes the circle at JSON.stringify (<anonymous>) at *%(basename)s:28:6 + diff --git a/deps/v8/test/message/fail/json-stringify-circular-substructure.out b/deps/v8/test/message/fail/json-stringify-circular-substructure.out index 7633ea24e8..2477be764f 100644 --- a/deps/v8/test/message/fail/json-stringify-circular-substructure.out +++ b/deps/v8/test/message/fail/json-stringify-circular-substructure.out @@ -8,3 +8,4 @@ TypeError: Converting circular structure to JSON --- property 'key' closes the circle at JSON.stringify (<anonymous>) at *%(basename)s:9:6 + diff --git a/deps/v8/test/message/fail/json-stringify-circular.out b/deps/v8/test/message/fail/json-stringify-circular.out index bfea54ef00..a701672c84 100644 --- a/deps/v8/test/message/fail/json-stringify-circular.out +++ b/deps/v8/test/message/fail/json-stringify-circular.out @@ -8,3 +8,4 @@ TypeError: Converting circular structure to JSON --- property 'key' closes the circle at JSON.stringify (<anonymous>) at *%(basename)s:8:6 + diff --git a/deps/v8/test/message/fail/wasm-async-compile-fail.js b/deps/v8/test/message/fail/wasm-async-compile-fail.js new file mode 100644 index 0000000000..250a389f9e --- /dev/null +++ b/deps/v8/test/message/fail/wasm-async-compile-fail.js @@ -0,0 +1,10 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +load('test/mjsunit/wasm/wasm-module-builder.js'); + +let builder = new WasmModuleBuilder(); +builder.addFunction('f', kSig_i_v).addBody([]); +let rethrow = e => setTimeout(_ => {throw e}, 0); +WebAssembly.compile(builder.toBuffer()).catch(rethrow); diff --git a/deps/v8/test/message/fail/wasm-async-compile-fail.out b/deps/v8/test/message/fail/wasm-async-compile-fail.out new file mode 100644 index 0000000000..0ecf9b1968 --- /dev/null +++ b/deps/v8/test/message/fail/wasm-async-compile-fail.out @@ -0,0 +1,5 @@ +*%(basename)s:9: CompileError: WebAssembly.compile(): Compiling function #0:"f" failed: expected 1 elements on the stack for fallthru to @1, found 0 @+24 +let rethrow = e => setTimeout(_ => {throw e}, 0); + ^ +CompileError: WebAssembly.compile(): Compiling function #0:"f" failed: expected 1 elements on the stack for fallthru to @1, found 0 @+24 + diff --git a/deps/v8/test/message/fail/wasm-async-instantiate-fail.js b/deps/v8/test/message/fail/wasm-async-instantiate-fail.js new file mode 100644 index 0000000000..624a17b5dd --- /dev/null +++ b/deps/v8/test/message/fail/wasm-async-instantiate-fail.js @@ -0,0 +1,10 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +load('test/mjsunit/wasm/wasm-module-builder.js'); + +let builder = new WasmModuleBuilder(); +builder.addFunction('f', kSig_i_v).addBody([]); +let rethrow = e => setTimeout(_ => {throw e}, 0); +WebAssembly.instantiate(builder.toBuffer()).catch(rethrow); diff --git a/deps/v8/test/message/fail/wasm-async-instantiate-fail.out b/deps/v8/test/message/fail/wasm-async-instantiate-fail.out new file mode 100644 index 0000000000..ebe2760dd2 --- /dev/null +++ b/deps/v8/test/message/fail/wasm-async-instantiate-fail.out @@ -0,0 +1,5 @@ +*%(basename)s:9: CompileError: WebAssembly.instantiate(): Compiling function #0:"f" failed: expected 1 elements on the stack for fallthru to @1, found 0 @+24 +let rethrow = e => setTimeout(_ => {throw e}, 0); + ^ +CompileError: WebAssembly.instantiate(): Compiling function #0:"f" failed: expected 1 elements on the stack for fallthru to @1, found 0 @+24 + diff --git a/deps/v8/test/message/fail/wasm-exception-rethrow.js b/deps/v8/test/message/fail/wasm-exception-rethrow.js new file mode 100644 index 0000000000..9731914ede --- /dev/null +++ b/deps/v8/test/message/fail/wasm-exception-rethrow.js @@ -0,0 +1,21 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Flags: --expose-wasm --experimental-wasm-eh + +load('test/mjsunit/wasm/wasm-module-builder.js'); + +let builder = new WasmModuleBuilder(); +let except = builder.addException(kSig_v_i); +builder.addFunction("rethrow0", kSig_v_v) + .addBody([ + kExprTry, kWasmStmt, + kExprI32Const, 23, + kExprThrow, except, + kExprCatch, + kExprRethrow, + kExprEnd, +]).exportFunc(); +let instance = builder.instantiate(); +instance.exports.rethrow0(); diff --git a/deps/v8/test/message/fail/wasm-exception-rethrow.out b/deps/v8/test/message/fail/wasm-exception-rethrow.out new file mode 100644 index 0000000000..98fdbc9376 --- /dev/null +++ b/deps/v8/test/message/fail/wasm-exception-rethrow.out @@ -0,0 +1,4 @@ +wasm-function[0]:5: RuntimeError: wasm exception +RuntimeError: wasm exception + at rethrow0 (wasm-function[0]:5) + at *%(basename)s:21:18 diff --git a/deps/v8/test/message/fail/wasm-exception-throw.js b/deps/v8/test/message/fail/wasm-exception-throw.js new file mode 100644 index 0000000000..620d693e02 --- /dev/null +++ b/deps/v8/test/message/fail/wasm-exception-throw.js @@ -0,0 +1,17 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Flags: --expose-wasm --experimental-wasm-eh + +load('test/mjsunit/wasm/wasm-module-builder.js'); + +let builder = new WasmModuleBuilder(); +let except = builder.addException(kSig_v_i); +builder.addFunction("throw0", kSig_v_v) + .addBody([ + kExprI32Const, 23, + kExprThrow, except, +]).exportFunc(); +let instance = builder.instantiate(); +instance.exports.throw0(); diff --git a/deps/v8/test/message/fail/wasm-exception-throw.out b/deps/v8/test/message/fail/wasm-exception-throw.out new file mode 100644 index 0000000000..65083190c6 --- /dev/null +++ b/deps/v8/test/message/fail/wasm-exception-throw.out @@ -0,0 +1,4 @@ +wasm-function[0]:3: RuntimeError: wasm exception +RuntimeError: wasm exception + at throw0 (wasm-function[0]:3) + at *%(basename)s:17:18 diff --git a/deps/v8/test/message/fail/wasm-streaming-compile-fail.js b/deps/v8/test/message/fail/wasm-streaming-compile-fail.js new file mode 100644 index 0000000000..e7c223b384 --- /dev/null +++ b/deps/v8/test/message/fail/wasm-streaming-compile-fail.js @@ -0,0 +1,12 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Flags: --wasm-test-streaming + +load('test/mjsunit/wasm/wasm-module-builder.js'); + +let builder = new WasmModuleBuilder(); +builder.addFunction('f', kSig_i_v).addBody([]); +let rethrow = e => setTimeout(_ => {throw e}, 0); +WebAssembly.compileStreaming(builder.toBuffer()).catch(rethrow); diff --git a/deps/v8/test/message/fail/wasm-streaming-compile-fail.out b/deps/v8/test/message/fail/wasm-streaming-compile-fail.out new file mode 100644 index 0000000000..d11d5ebf84 --- /dev/null +++ b/deps/v8/test/message/fail/wasm-streaming-compile-fail.out @@ -0,0 +1,5 @@ +*%(basename)s:11: CompileError: WebAssembly.compileStreaming(): Compiling function #0:"f" failed: expected 1 elements on the stack for fallthru to @1, found 0 @+24 +let rethrow = e => setTimeout(_ => {throw e}, 0); + ^ +CompileError: WebAssembly.compileStreaming(): Compiling function #0:"f" failed: expected 1 elements on the stack for fallthru to @1, found 0 @+24 + diff --git a/deps/v8/test/message/fail/wasm-streaming-instantiate-fail.js b/deps/v8/test/message/fail/wasm-streaming-instantiate-fail.js new file mode 100644 index 0000000000..39d9158e1a --- /dev/null +++ b/deps/v8/test/message/fail/wasm-streaming-instantiate-fail.js @@ -0,0 +1,12 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Flags: --wasm-test-streaming + +load('test/mjsunit/wasm/wasm-module-builder.js'); + +let builder = new WasmModuleBuilder(); +builder.addFunction('f', kSig_i_v).addBody([]); +let rethrow = e => setTimeout(_ => {throw e}, 0); +WebAssembly.instantiateStreaming(builder.toBuffer()).catch(rethrow); diff --git a/deps/v8/test/message/fail/wasm-streaming-instantiate-fail.out b/deps/v8/test/message/fail/wasm-streaming-instantiate-fail.out new file mode 100644 index 0000000000..d8cd334de0 --- /dev/null +++ b/deps/v8/test/message/fail/wasm-streaming-instantiate-fail.out @@ -0,0 +1,5 @@ +*%(basename)s:11: CompileError: WebAssembly.instantiateStreaming(): Compiling function #0:"f" failed: expected 1 elements on the stack for fallthru to @1, found 0 @+24 +let rethrow = e => setTimeout(_ => {throw e}, 0); + ^ +CompileError: WebAssembly.instantiateStreaming(): Compiling function #0:"f" failed: expected 1 elements on the stack for fallthru to @1, found 0 @+24 + diff --git a/deps/v8/test/message/fail/wasm-sync-compile-fail.js b/deps/v8/test/message/fail/wasm-sync-compile-fail.js new file mode 100644 index 0000000000..98e09efbc1 --- /dev/null +++ b/deps/v8/test/message/fail/wasm-sync-compile-fail.js @@ -0,0 +1,9 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +load('test/mjsunit/wasm/wasm-module-builder.js'); + +let builder = new WasmModuleBuilder(); +builder.addFunction('f', kSig_i_v).addBody([]); +new WebAssembly.Module(builder.toBuffer()); diff --git a/deps/v8/test/message/fail/wasm-sync-compile-fail.out b/deps/v8/test/message/fail/wasm-sync-compile-fail.out new file mode 100644 index 0000000000..849fc202ee --- /dev/null +++ b/deps/v8/test/message/fail/wasm-sync-compile-fail.out @@ -0,0 +1,6 @@ +*%(basename)s:9: CompileError: WebAssembly.Module(): Compiling function #0:"f" failed: expected 1 elements on the stack for fallthru to @1, found 0 @+24 +new WebAssembly.Module(builder.toBuffer()); +^ +CompileError: WebAssembly.Module(): Compiling function #0:"f" failed: expected 1 elements on the stack for fallthru to @1, found 0 @+24 + at *%(basename)s:9:1 + |