1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
6 Returns keys in their corresponding order.
8 26.1.11 Reflect.ownKeys ( target )
11 2. Let keys be target.[[OwnPropertyKeys]]().
12 3. ReturnIfAbrupt(keys).
13 4. Return CreateArrayFromList(keys).
15 9.1.12 [[OwnPropertyKeys]] ( )
17 1. Let keys be a new empty List.
18 2. For each own property key P of O that is an integer index, in ascending
20 a. Add P as the last element of keys.
21 3. For each own property key P of O that is a String but is not an integer
22 index, in property creation order
23 a. Add P as the last element of keys.
24 4. For each own property key P of O that is a Symbol, in property creation
26 a. Add P as the last element of keys.
28 features: [Reflect, Symbol]
45 var result = Reflect.ownKeys(o);
47 assert.sameValue(result.length, 7);
48 assert.sameValue(result[0], '0');
49 assert.sameValue(result[1], '1');
50 assert.sameValue(result[2], '2');
51 assert.sameValue(result[3], 'p1');
52 assert.sameValue(result[4], 'p2');
53 assert.sameValue(result[5], s1);
54 assert.sameValue(result[6], s2);