Debian Codegraph @

js/src/tests/test262/built-ins/String/S15.5.5.1_A2.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: length property has the attributes {DontEnum}
6 es5id: 15.5.5.1_A2
7 description: Checking if enumerating the length property of String fails
8 ---*/
9
10 var __str__instance = new String("globglob");
11
12 //////////////////////////////////////////////////////////////////////////////
13 //CHECK#1
14 if (!(__str__instance.hasOwnProperty("length"))) {
15 throw new Test262Error('#1: var __str__instance = new String("globglob"); __str__instance.hasOwnProperty("length") return true. Actual: ' + __str__instance.hasOwnProperty("length"));
16 }
17 //
18 //////////////////////////////////////////////////////////////////////////////
19
20 //////////////////////////////////////////////////////////////////////////////
21 //CHECK#2
22 for (var prop in __str__instance) {
23 if (prop === "length") {
24 throw new Test262Error('#2: length property has the attributes {DontEnum}');
25 }
26 }
27 //
28 //////////////////////////////////////////////////////////////////////////////
29
30 reportCompare(0, 0);