diff options
Diffstat (limited to 'deps/v8/test/mjsunit/regress/regress-8033.js')
-rw-r--r-- | deps/v8/test/mjsunit/regress/regress-8033.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/regress/regress-8033.js b/deps/v8/test/mjsunit/regress/regress-8033.js new file mode 100644 index 00000000000..437ca2a0a6a --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-8033.js @@ -0,0 +1,45 @@ +// 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. + +assertThrows("foo: if (true) do { continue foo } while (false)", SyntaxError); +assertThrows("foo: if (true) while (false) { continue foo }", SyntaxError); +assertThrows("foo: if (true) for (; false; ) { continue foo }", SyntaxError); +assertThrows("foo: if (true) for (let x of []) { continue foo }", SyntaxError); +assertThrows("foo: if (true) for (let x in []) { continue foo }", SyntaxError); + +assertThrows("foo: if (true) { do { continue foo } while (false) }", SyntaxError); +assertThrows("foo: if (true) { while (false) { continue foo } }", SyntaxError); +assertThrows("foo: if (true) { for (; false; ) { continue foo } }", SyntaxError); +assertThrows("foo: if (true) { for (let x of []) { continue foo } }", SyntaxError); +assertThrows("foo: if (true) { for (let x in []) { continue foo } }", SyntaxError); + +assertThrows("foo: goo: if (true) do { continue foo } while (false)", SyntaxError); +assertThrows("foo: goo: if (true) while (false) { continue foo }", SyntaxError); +assertThrows("foo: goo: if (true) for (; false; ) { continue foo }", SyntaxError); +assertThrows("foo: goo: if (true) for (let x of []) { continue foo }", SyntaxError); +assertThrows("foo: goo: if (true) for (let x in []) { continue foo }", SyntaxError); + +assertThrows("foo: goo: if (true) { do { continue foo } while (false) }", SyntaxError); +assertThrows("foo: goo: if (true) { while (false) { continue foo } }", SyntaxError); +assertThrows("foo: goo: if (true) { for (; false; ) { continue foo } }", SyntaxError); +assertThrows("foo: goo: if (true) { for (let x of []) { continue foo } }", SyntaxError); +assertThrows("foo: goo: if (true) { for (let x in []) { continue foo } }", SyntaxError); + +assertDoesNotThrow("if (true) foo: goo: do { continue foo } while (false)"); +assertDoesNotThrow("if (true) foo: goo: while (false) { continue foo }"); +assertDoesNotThrow("if (true) foo: goo: for (; false; ) { continue foo }"); +assertDoesNotThrow("if (true) foo: goo: for (let x of []) { continue foo }"); +assertDoesNotThrow("if (true) foo: goo: for (let x in []) { continue foo }"); + +assertThrows("if (true) foo: goo: { do { continue foo } while (false) }", SyntaxError); +assertThrows("if (true) foo: goo: { while (false) { continue foo } }", SyntaxError); +assertThrows("if (true) foo: goo: { for (; false; ) { continue foo } }", SyntaxError); +assertThrows("if (true) foo: goo: { for (let x of []) { continue foo } }", SyntaxError); +assertThrows("if (true) foo: goo: { for (let x in []) { continue foo } }", SyntaxError); + +assertDoesNotThrow("if (true) { foo: goo: do { continue foo } while (false) }"); +assertDoesNotThrow("if (true) { foo: goo: while (false) { continue foo } }"); +assertDoesNotThrow("if (true) { foo: goo: for (; false; ) { continue foo } }"); +assertDoesNotThrow("if (true) { foo: goo: for (let x of []) { continue foo } }"); +assertDoesNotThrow("if (true) { foo: goo: for (let x in []) { continue foo } }"); |