Debian Codegraph @

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