Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/getOwnPropertyNames/S15.2.3.4_A1_T1.js

raw
1 // Copyright 2011 Google, Inc. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: |
6 Object.getOwnProperties and Object.prototype.hasOwnProperty should
7 agree on what the own properties are.
8 es5id: 15.2.3.4_A1_T1
9 description: >
10 Check that all the own property names reported by
11 Object.getOwnPropertyNames on a strict function are names that
12 hasOwnProperty agrees are own properties.
13 ---*/
14
15 function foo() {}
16
17 var names = Object.getOwnPropertyNames(foo);
18 for (var i = 0, len = names.length; i < len; i++) {
19 if (!foo.hasOwnProperty(names[i])) {
20 $ERROR('Phantom own property: ' + names[i]);
21 }
22 }