Debian Codegraph @

js/src/tests/test262/language/statements/for/S12.6.3_A10_T2.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: Nested "var-loops" nine blocks depth is evaluated properly
6 es5id: 12.6.3_A10
7 description: >
8 Checking if executing nested "var-loops" nine blocks depth is
9 evaluated properly
10 ---*/
11
12 var __str, index0, index1, index2, index3, index4, index5, index6, index7, index8;
13
14 //////////////////////////////////////////////////////////////////////////////
15 //CHECK#
16 try {
17 __in__deepest__loop=__in__deepest__loop;
18 } catch (e) {
19 throw new Test262Error('#1: "__in__deepest__loop=__in__deepest__loop" does not lead to throwing exception');
20 }
21 //
22 //////////////////////////////////////////////////////////////////////////////
23
24 __str="";
25
26 for( index0=0; index0<=1; index0++) {
27 for( index1=0; index1<=index0; index1++) {
28 for( index2=0; index2<=index1; index2++) {
29 for( index3=0; index3<=index2; index3++) {
30 for( index4=0; index4<=index3; index4++) {
31 for( index5=0; index5<=index4; index5++) {
32 for( index6=0; index6<=index5; index6++) {
33 for( index7=0; index7<=index6; index7++) {
34 for( index8=0; index8<=index1; index8++) {
35 var __in__deepest__loop;
36 __str+=""+index0+index1+index2+index3+index4+index5+index6+index7+index8+'\n';
37 }
38 }
39 }
40 }
41 }
42 }
43 }
44 }
45 }
46
47 //////////////////////////////////////////////////////////////////////////////
48 //CHECK#2
49 if (__str!== "000000000\n100000000\n110000000\n110000001\n111000000\n111000001\n111100000\n111100001\n111110000\n111110001\n111111000\n111111001\n111111100\n111111101\n111111110\n111111111\n") {
50 throw new Test262Error('#2: __str === "000000000\\n100000000\\n110000000\\n110000001\\n111000000\\n111000001\\n111100000\\n111100001\\n111110000\\n111110001\\n111111000\\n111111001\\n111111100\\n111111101\\n111111110\\n111111111\\n". Actual: __str ==='+ __str );
51 }
52 //
53 //////////////////////////////////////////////////////////////////////////////
54
55 reportCompare(0, 0);