S12.6.3_A10.1_T2.js (3762B)
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.1 7 description: > 8 Checking if executing nested "var-loops" nine blocks depth is 9 evaluated properly 10 ---*/ 11 12 var __str, index2, index3, index6; 13 14 ////////////////////////////////////////////////////////////////////////////// 15 //CHECK#1 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 ////////////////////////////////////////////////////////////////////////////// 25 //CHECK#2 26 try { 27 index0=index0; 28 } catch (e) { 29 throw new Test262Error('#2: "index0=index0" does not lead to throwing exception'); 30 } 31 // 32 ////////////////////////////////////////////////////////////////////////////// 33 34 ////////////////////////////////////////////////////////////////////////////// 35 //CHECK#3 36 try { 37 index1=index1; 38 } catch (e) { 39 throw new Test262Error('#3: "index1=index1" does not lead to throwing exception'); 40 } 41 // 42 ////////////////////////////////////////////////////////////////////////////// 43 44 ////////////////////////////////////////////////////////////////////////////// 45 //CHECK#4 46 try { 47 index4=index4; 48 } catch (e) { 49 throw new Test262Error('#4: "index4=index4" does not lead to throwing exception'); 50 } 51 // 52 ////////////////////////////////////////////////////////////////////////////// 53 54 ////////////////////////////////////////////////////////////////////////////// 55 //CHECK#5 56 try { 57 index5=index5; 58 } catch (e) { 59 throw new Test262Error('#4: "index5=index5" does not lead to throwing exception'); 60 } 61 // 62 ////////////////////////////////////////////////////////////////////////////// 63 64 ////////////////////////////////////////////////////////////////////////////// 65 //CHECK#6 66 try { 67 index7=index7; 68 } catch (e) { 69 throw new Test262Error('#6: "index7=index7" does not lead to throwing exception'); 70 } 71 // 72 ////////////////////////////////////////////////////////////////////////////// 73 74 ////////////////////////////////////////////////////////////////////////////// 75 //CHECK#7 76 try { 77 index8=index8; 78 } catch (e) { 79 throw new Test262Error('#7: "index8=index8" does not lead to throwing exception'); 80 } 81 // 82 ////////////////////////////////////////////////////////////////////////////// 83 84 __str=""; 85 86 for( var index0=0; index0<=1; index0++) { 87 for(var index1=0; index1<=index0; index1++) { 88 for( index2=0; index2<=index1; index2++) { 89 for( index3=0; index3<=index2; index3++) { 90 for(var index4=0; index4<=index3; index4++) { 91 for(var index5=0; index5<=index4; index5++) { 92 for( index6=0; index6<=index5; index6++) { 93 for(var index7=0; index7<=index6; index7++) { 94 for(var index8=0; index8<=index1; index8++) { 95 var __in__deepest__loop; 96 __str+=""+index0+index1+index2+index3+index4+index5+index6+index7+index8+'\n'; 97 } 98 } 99 } 100 } 101 } 102 } 103 } 104 } 105 } 106 107 ////////////////////////////////////////////////////////////////////////////// 108 //CHECK#2 109 if (__str!== "000000000\n100000000\n110000000\n110000001\n111000000\n111000001\n111100000\n111100001\n111110000\n111110001\n111111000\n111111001\n111111100\n111111101\n111111110\n111111111\n") { 110 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 ); 111 } 112 // 113 ////////////////////////////////////////////////////////////////////////////// 114 115 reportCompare(0, 0);