summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/for-in/order-enumerable-shadowed.js
blob: f1315a7ad46f0416fe6e6d88fd8728845be4f5f5 (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
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2019 Kevin Gibbons. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-enumerate-object-properties
description: Enumerable properties the prototype which are shadowed by non-enumerable properties on the object are not enumerated
features: [for-in-order]
includes: [compareArray.js]
---*/

var proto = {
  p2: 'p2',
};

var o = Object.create(proto, {
  'p1': {
    value: 'p1',
    enumerable: true,
  },
  'p2': {
    value: 'p1',
    enumerable: false,
  },
});



var keys = [];
for (var key in o) {
  keys.push(key);
}

assert.compareArray(keys, ['p1']);

reportCompare(0, 0);