diff --git a/test/language/statements/do-while/labeled-fn-stmt.js b/test/language/statements/do-while/labelled-fn-stmt.js similarity index 100% rename from test/language/statements/do-while/labeled-fn-stmt.js rename to test/language/statements/do-while/labelled-fn-stmt.js diff --git a/test/language/statements/for-in/labeled-fn-stmt-const.js b/test/language/statements/for-in/labelled-fn-stmt-const.js similarity index 100% rename from test/language/statements/for-in/labeled-fn-stmt-const.js rename to test/language/statements/for-in/labelled-fn-stmt-const.js diff --git a/test/language/statements/for-in/labeled-fn-stmt-let.js b/test/language/statements/for-in/labelled-fn-stmt-let.js similarity index 100% rename from test/language/statements/for-in/labeled-fn-stmt-let.js rename to test/language/statements/for-in/labelled-fn-stmt-let.js diff --git a/test/language/statements/for-in/labeled-fn-stmt-lhs.js b/test/language/statements/for-in/labelled-fn-stmt-lhs.js similarity index 100% rename from test/language/statements/for-in/labeled-fn-stmt-lhs.js rename to test/language/statements/for-in/labelled-fn-stmt-lhs.js diff --git a/test/language/statements/for-in/labeled-fn-stmt-var.js b/test/language/statements/for-in/labelled-fn-stmt-var.js similarity index 100% rename from test/language/statements/for-in/labeled-fn-stmt-var.js rename to test/language/statements/for-in/labelled-fn-stmt-var.js diff --git a/test/language/statements/for-of/labeled-fn-stmt-const.js b/test/language/statements/for-of/labelled-fn-stmt-const.js similarity index 100% rename from test/language/statements/for-of/labeled-fn-stmt-const.js rename to test/language/statements/for-of/labelled-fn-stmt-const.js diff --git a/test/language/statements/for-of/labeled-fn-stmt-let.js b/test/language/statements/for-of/labelled-fn-stmt-let.js similarity index 100% rename from test/language/statements/for-of/labeled-fn-stmt-let.js rename to test/language/statements/for-of/labelled-fn-stmt-let.js diff --git a/test/language/statements/for-of/labeled-fn-stmt-lhs.js b/test/language/statements/for-of/labelled-fn-stmt-lhs.js similarity index 100% rename from test/language/statements/for-of/labeled-fn-stmt-lhs.js rename to test/language/statements/for-of/labelled-fn-stmt-lhs.js diff --git a/test/language/statements/for-of/labeled-fn-stmt-var.js b/test/language/statements/for-of/labelled-fn-stmt-var.js similarity index 100% rename from test/language/statements/for-of/labeled-fn-stmt-var.js rename to test/language/statements/for-of/labelled-fn-stmt-var.js diff --git a/test/language/statements/for/labeled-fn-stmt-const.js b/test/language/statements/for/labelled-fn-stmt-const.js similarity index 100% rename from test/language/statements/for/labeled-fn-stmt-const.js rename to test/language/statements/for/labelled-fn-stmt-const.js diff --git a/test/language/statements/for/labeled-fn-stmt-expr.js b/test/language/statements/for/labelled-fn-stmt-expr.js similarity index 100% rename from test/language/statements/for/labeled-fn-stmt-expr.js rename to test/language/statements/for/labelled-fn-stmt-expr.js diff --git a/test/language/statements/for/labeled-fn-stmt-let.js b/test/language/statements/for/labelled-fn-stmt-let.js similarity index 100% rename from test/language/statements/for/labeled-fn-stmt-let.js rename to test/language/statements/for/labelled-fn-stmt-let.js diff --git a/test/language/statements/for/labeled-fn-stmt-var.js b/test/language/statements/for/labelled-fn-stmt-var.js similarity index 100% rename from test/language/statements/for/labeled-fn-stmt-var.js rename to test/language/statements/for/labelled-fn-stmt-var.js diff --git a/test/language/statements/if/labelled-fn-stmt-first.js b/test/language/statements/if/labelled-fn-stmt-first.js new file mode 100644 index 0000000000..b17aaafec8 --- /dev/null +++ b/test/language/statements/if/labelled-fn-stmt-first.js @@ -0,0 +1,25 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-if-statement-static-semantics-early-errors +es6id: 13.6.1 +description: > + A labelled function declaration is never permitted in the first of two + Statement positions +info: | + IfStatement : + + if ( Expression ) Statement else Statement + if ( Expression ) Statement + + - It is a Syntax Error if IsLabelledFunction(Statement) is true. + + NOTE It is only necessary to apply this rule if the extension specified in + B.3.2 is implemented. + + In the absence of Annex B.3.2, a SyntaxError should be produced due to the + labelled function declaration itself. +negative: SyntaxError +---*/ + +if (false) label1: label2: function test262() {} else ; diff --git a/test/language/statements/if/labelled-fn-stmt-lone.js b/test/language/statements/if/labelled-fn-stmt-lone.js new file mode 100644 index 0000000000..c6e03f3700 --- /dev/null +++ b/test/language/statements/if/labelled-fn-stmt-lone.js @@ -0,0 +1,25 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-if-statement-static-semantics-early-errors +es6id: 13.6.1 +description: > + A labelled function declaration is never permitted in the sole Statement + position +info: | + IfStatement : + + if ( Expression ) Statement else Statement + if ( Expression ) Statement + + - It is a Syntax Error if IsLabelledFunction(Statement) is true. + + NOTE It is only necessary to apply this rule if the extension specified in + B.3.2 is implemented. + + In the absence of Annex B.3.2, a SyntaxError should be produced due to the + labelled function declaration itself. +negative: SyntaxError +---*/ + +if (false) label1: label2: function test262() {} diff --git a/test/language/statements/if/labelled-fn-stmt-second.js b/test/language/statements/if/labelled-fn-stmt-second.js new file mode 100644 index 0000000000..6433ce9dd4 --- /dev/null +++ b/test/language/statements/if/labelled-fn-stmt-second.js @@ -0,0 +1,25 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-if-statement-static-semantics-early-errors +es6id: 13.6.1 +description: > + A labelled function declaration is never permitted in the second of two + Statement positions +info: | + IfStatement : + + if ( Expression ) Statement else Statement + if ( Expression ) Statement + + - It is a Syntax Error if IsLabelledFunction(Statement) is true. + + NOTE It is only necessary to apply this rule if the extension specified in + B.3.2 is implemented. + + In the absence of Annex B.3.2, a SyntaxError should be produced due to the + labelled function declaration itself. +negative: SyntaxError +---*/ + +if (true) ; else label1: label2: function test262() {} diff --git a/test/language/statements/while/labeled-fn-stmt.js b/test/language/statements/while/labelled-fn-stmt.js similarity index 100% rename from test/language/statements/while/labeled-fn-stmt.js rename to test/language/statements/while/labelled-fn-stmt.js diff --git a/test/language/statements/with/labelled-fn-stmt.js b/test/language/statements/with/labelled-fn-stmt.js new file mode 100644 index 0000000000..4725c360f3 --- /dev/null +++ b/test/language/statements/with/labelled-fn-stmt.js @@ -0,0 +1,22 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-with-statement-static-semantics-early-errors +es6id: 13.11.1 +description: + A labelled function declaration is never permitted in the Statement position +info: | + WithStatementa: with ( Expression ) Statement + + [...] + - It is a Syntax Error if IsLabelledFunction(Statement) is true. + + NOTE It is only necessary to apply the second rule if the extension specified + in B.3.2 is implemented. + + In the absence of Annex B.3.2, a SyntaxError should be produced due to the + labelled function declaration itself. +negative: SyntaxError +---*/ + +with ({}) label1: label2: function test262() {}