Debian Codegraph @

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