Debian Codegraph @

js/src/tests/test262/language/statements/break/S12.8_A5_T3.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_T3
10 description: >
11 Checking if using internal loop label as an Identifier appears to
12 be 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 LABEL_IN;
27 LABEL_IN_2 : y++;
28
29 function IN_DO_FUNC(){}
30
31 } while(0);
32
33 LABEL_ANOTHER_LOOP : do {
34 ;
35 } while(0);
36
37 function OUT_FUNC(){}
38
39 })();