S12.6.1_A7.js (1000B)
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: | 6 The "do-while" Statement is evaluted according to 12.6.1 and returns 7 (normal, V, empty) 8 es5id: 12.6.1_A7 9 description: Using eval 10 ---*/ 11 12 var __evaluated; 13 var __condition=0 14 15 __evaluated = eval("do eval(\"__condition++\"); while (__condition<5)"); 16 17 ////////////////////////////////////////////////////////////////////////////// 18 //CHECK#1 19 if (__condition !== 5) { 20 throw new Test262Error('#1: The "do-while" statement is evaluted according to the Standard '); 21 } 22 // 23 ////////////////////////////////////////////////////////////////////////////// 24 25 ////////////////////////////////////////////////////////////////////////////// 26 //CHECK#2 27 if (__evaluated !== 4) { 28 throw new Test262Error('#2: The "do-while" statement returns (normal, V, empty)'); 29 } 30 // 31 ////////////////////////////////////////////////////////////////////////////// 32 33 reportCompare(0, 0);