Debian Codegraph @

js/src/tests/test262/language/statements/break/S12.8_A5_T2.js

raw
1 // |reftest| error:SyntaxError
2 // Copyright 2009 the Sputnik authors. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 info: |
7 Identifier must be label in the label set of an enclosing (but not
8 crossing function boundaries) IterationStatement
9 es5id: 12.8_A5_T2
10 description: >
11 Checking if using function name as an Identifier appears to be
12 invalid
13 negative:
14 phase: parse
15 type: SyntaxError
16 ---*/
17
18 $DONOTEVALUATE();
19
20 (function(){
21 LABEL_OUT : var x=0, y=0;
22 LABEL_DO_LOOP : do {
23 LABEL_IN : x++;
24 if(x===10)
25 return;
26 break IN_DO_FUNC;
27 LABEL_IN_2 : y++;
28 function IN_DO_FUNC(){}
29 } while(0);
30
31 LABEL_ANOTHER_LOOP : do {
32 ;
33 } while(0);
34
35 function OUT_FUNC(){}
36 })();