Debian Codegraph @

js/src/tests/test262/language/statements/for/S12.6.3_A15.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 production IterationStatement: "for (var VariableDeclarationListNoIn;
7 Expression; Expression) Statement"
8 es5id: 12.6.3_A15
9 description: Statement must be evaluated before second Expression is evaluated
10 ---*/
11
12 //CHECK#1
13 for(var i=0;i<10;i++){
14 i*=2;
15 break;
16 }
17 if (i!==0) throw new Test262Error('#1: i === 0. Actual: i ==='+ i );
18
19 //CHECK#2
20 for(var i=0;i<10;i++){
21 i*=2;
22 if (i===3) throw new Test262Error('#2: i !== 3');
23 }
24
25 reportCompare(0, 0);