| 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.values.length); | 8 assertEquals(1, Object.values.length); |
| 10 assertEquals(Function.prototype, Object.getPrototypeOf(Object.values)); | 9 assertEquals(Function.prototype, Object.getPrototypeOf(Object.values)); |
| 11 assertEquals("values", Object.values.name); | 10 assertEquals("values", Object.values.name); |
| 12 | 11 |
| 13 var descriptor = Object.getOwnPropertyDescriptor(Object, "values"); | 12 var descriptor = Object.getOwnPropertyDescriptor(Object, "values"); |
| 14 assertTrue(descriptor.writable); | 13 assertTrue(descriptor.writable); |
| 15 assertFalse(descriptor.enumerable); | 14 assertFalse(descriptor.enumerable); |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 282 |
| 284 for (let [kind, [object, expected]] of Object.entries(element_kinds)) { | 283 for (let [kind, [object, expected]] of Object.entries(element_kinds)) { |
| 285 let result1 = Object.values(object); | 284 let result1 = Object.values(object); |
| 286 assertEquals(expected, result1, `fast Object.values() with ${kind}`); | 285 assertEquals(expected, result1, `fast Object.values() with ${kind}`); |
| 287 | 286 |
| 288 let proxy = new Proxy(object, {}); | 287 let proxy = new Proxy(object, {}); |
| 289 let result2 = Object.values(proxy); | 288 let result2 = Object.values(proxy); |
| 290 assertEquals(result1, result2, `slow Object.values() with ${kind}`); | 289 assertEquals(result1, result2, `slow Object.values() with ${kind}`); |
| 291 } | 290 } |
| 292 })(); | 291 })(); |
| OLD | NEW |