Debian Codegraph @

js/src/tests/test262/built-ins/eval/length-enumerable.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: The length property of eval has the attribute DontEnum
6 esid: sec-eval-x
7 description: Checking use propertyIsEnumerable, for-in
8 ---*/
9
10 //CHECK#1
11 if (eval.propertyIsEnumerable('length') !== false) {
12 throw new Test262Error('#1: eval.propertyIsEnumerable(\'length\') === false. Actual: ' + (eval.propertyIsEnumerable('length')));
13 }
14
15 //CHECK#2
16 var result = true;
17 for (p in eval) {
18 if (p === "length") {
19 result = false;
20 }
21 }
22
23 if (result !== true) {
24 throw new Test262Error('#2: result = true; for (p in eval) { if (p === "length") result = false; }; result === true;');
25 }
26
27 reportCompare(0, 0);