Debian Codegraph @

js/src/tests/test262/language/statements/for/S12.6.3_A2.2.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 While evaluating "for (ExpressionNoIn;;) Statement", Statement is
7 evaulated first
8 es5id: 12.6.3_A2.2
9 description: Using "(function(){throw "NoInExpression"})()" as ExpressionNoIn
10 ---*/
11
12 //////////////////////////////////////////////////////////////////////////////
13 //CHECK#1
14 try {
15 for((function(){throw "NoInExpression"})();;) {
16 throw "Statement";
17 }
18 throw new Test262Error('#1: (function(){throw "NoInExpression"})() lead to throwing exception');
19 } catch (e) {
20 if (e !== "NoInExpression") {
21 throw new Test262Error('#1: When for (ExpressionNoIn ; ; ) Statement is evaluated NoInExpression evaluates first');
22 }
23 }
24 //
25 //////////////////////////////////////////////////////////////////////////////
26
27 reportCompare(0, 0);