Debian Codegraph @

js/src/tests/test262/language/statements/while/S12.6.2_A14_T2.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: FunctionExpression within a "while" Expression is allowed
6 es5id: 12.6.2_A14_T2
7 description: Using function call as an Expression
8 ---*/
9
10 //////////////////////////////////////////////////////////////////////////////
11 //CHECK#
12 while(function __func(){return 1;}()){
13 var __reached = 1;
14 break;
15 };
16 //
17 //////////////////////////////////////////////////////////////////////////////
18
19 //////////////////////////////////////////////////////////////////////////////
20 //CHECK#2
21 if (__reached !== 1) {
22 throw new Test262Error('#2: function expression inside of while expression is allowed');
23 }
24 //
25 //////////////////////////////////////////////////////////////////////////////
26
27 reportCompare(0, 0);