labelled-fn-stmt.js (821B)
1 // |reftest| error:SyntaxError 2 // Copyright (C) 2016 the V8 project authors. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 /*--- 5 esid: sec-with-statement-static-semantics-early-errors 6 es6id: 13.11.1 7 description: > 8 A labelled function declaration is never permitted in the Statement position 9 info: | 10 WithStatementa: with ( Expression ) Statement 11 12 [...] 13 - It is a Syntax Error if IsLabelledFunction(Statement) is true. 14 15 NOTE It is only necessary to apply the second rule if the extension specified 16 in B.3.2 is implemented. 17 18 In the absence of Annex B.3.2, a SyntaxError should be produced due to the 19 labelled function declaration itself. 20 negative: 21 phase: parse 22 type: SyntaxError 23 ---*/ 24 25 $DONOTEVALUATE(); 26 27 with ({}) label1: label2: function test262() {}