Debian Codegraph @

js/src/tests/test262/language/statements/for-in/S12.6.4_A1.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: "\"for(key in undefined)\" Statement is allowed"
6 es5id: 12.6.4_A1
7 description: Checking if execution of "for(key in undefined)" passes
8 ---*/
9
10 //////////////////////////////////////////////////////////////////////////////
11 //CHECK#1
12 try {
13 for(__key in undefined){
14 var key=__key;
15 };
16 } catch (e) {
17 throw new Test262Error('#1: "for(key in undefined){}" does not lead to throwing exception');
18 }
19 //
20 //////////////////////////////////////////////////////////////////////////////
21
22
23 //////////////////////////////////////////////////////////////////////////////
24 //CHECK#2
25 if (key!==undefined) {
26 throw new Test262Error('#2: key === undefined. Actual: key === '+key);
27 }
28 //
29 //////////////////////////////////////////////////////////////////////////////
30
31 reportCompare(0, 0);