OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --harmony-object-values-entries | |
6 // Flags: --allow-natives-syntax | 5 // Flags: --allow-natives-syntax |
7 | 6 |
8 function TestMeta() { | 7 function TestMeta() { |
9 assertEquals(1, Object.entries.length); | 8 assertEquals(1, Object.entries.length); |
10 assertEquals(Function.prototype, Object.getPrototypeOf(Object.entries)); | 9 assertEquals(Function.prototype, Object.getPrototypeOf(Object.entries)); |
11 assertEquals("entries", Object.entries.name); | 10 assertEquals("entries", Object.entries.name); |
12 | 11 |
13 var descriptor = Object.getOwnPropertyDescriptor(Object, "entries"); | 12 var descriptor = Object.getOwnPropertyDescriptor(Object, "entries"); |
14 assertTrue(descriptor.writable); | 13 assertTrue(descriptor.writable); |
15 assertFalse(descriptor.enumerable); | 14 assertFalse(descriptor.enumerable); |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 | 305 |
307 for (let [kind, [object, expected]] of Object.entries(element_kinds)) { | 306 for (let [kind, [object, expected]] of Object.entries(element_kinds)) { |
308 let result1 = Object.entries(object); | 307 let result1 = Object.entries(object); |
309 assertEquals(expected, result1, `fast Object.entries() with ${kind}`); | 308 assertEquals(expected, result1, `fast Object.entries() with ${kind}`); |
310 | 309 |
311 let proxy = new Proxy(object, {}); | 310 let proxy = new Proxy(object, {}); |
312 let result2 = Object.entries(proxy); | 311 let result2 = Object.entries(proxy); |
313 assertEquals(result1, result2, `slow Object.entries() with ${kind}`); | 312 assertEquals(result1, result2, `slow Object.entries() with ${kind}`); |
314 } | 313 } |
315 })(); | 314 })(); |
OLD | NEW |