summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Object/getOwnPropertyNames/S15.2.3.4_A1_T1.js
blob: f57b0c1a779fc24961db24721b03c6558f7031da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright 2011 Google, Inc.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
info: |
    Object.getOwnProperties and Object.prototype.hasOwnProperty should
    agree on what the own properties are.
es5id: 15.2.3.4_A1_T1
description: >
    Check that all the own property names reported by
    Object.getOwnPropertyNames on a strict function are names that
    hasOwnProperty agrees are own properties.
---*/

function foo() {}

var names = Object.getOwnPropertyNames(foo);
for (var i = 0, len = names.length; i < len; i++) {
  if (!foo.hasOwnProperty(names[i])) {
    $ERROR('Phantom own property: ' + names[i]);
  }
}

reportCompare(0, 0);