blob: 6c066eeb32c33c5c363ee9ee2476f94d3d70be75 (
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: Property enumeration order for simple objects
features: [for-in-order]
includes: [compareArray.js]
---*/
var o = {
p1: 'p1',
p2: 'p2',
p3: 'p3',
};
o.p4 = 'p4';
o[2] = '2';
o[0] = '0';
o[1] = '1';
delete o.p1;
delete o.p3;
o.p1 = 'p1';
var keys = [];
for (var key in o) {
keys.push(key);
}
assert.compareArray(keys, ['0', '1', '2', 'p2', 'p4', 'p1']);
reportCompare(0, 0);
|