| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 // Based on Mozilla Array.of() tests at http://dxr.mozilla.org/mozilla-central/s
ource/js/src/jit-test/tests/collections | 5 // Based on Mozilla Array.of() tests at http://dxr.mozilla.org/mozilla-central/s
ource/js/src/jit-test/tests/collections |
| 6 | 6 |
| 7 // Flags: --harmony-arrays | |
| 8 | |
| 9 | 7 |
| 10 | 8 |
| 11 // Array.of makes real arrays. | 9 // Array.of makes real arrays. |
| 12 | 10 |
| 13 function check(a) { | 11 function check(a) { |
| 14 assertEquals(Object.getPrototypeOf(a), Array.prototype); | 12 assertEquals(Object.getPrototypeOf(a), Array.prototype); |
| 15 assertEquals(Array.isArray(a), true); | 13 assertEquals(Array.isArray(a), true); |
| 16 a[9] = 9; | 14 a[9] = 9; |
| 17 assertEquals(a.length, 10); | 15 assertEquals(a.length, 10); |
| 18 } | 16 } |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 assertEquals(1, xlength.value); | 203 assertEquals(1, xlength.value); |
| 206 assertEquals(true, xlength.writable); | 204 assertEquals(true, xlength.writable); |
| 207 assertEquals(true, xlength.enumerable); | 205 assertEquals(true, xlength.enumerable); |
| 208 assertEquals(true, xlength.configurable); | 206 assertEquals(true, xlength.configurable); |
| 209 var x0 = Object.getOwnPropertyDescriptor(x, 0); | 207 var x0 = Object.getOwnPropertyDescriptor(x, 0); |
| 210 assertEquals(2, x0.value); | 208 assertEquals(2, x0.value); |
| 211 assertEquals(true, xlength.writable); | 209 assertEquals(true, xlength.writable); |
| 212 assertEquals(true, xlength.enumerable); | 210 assertEquals(true, xlength.enumerable); |
| 213 assertEquals(true, xlength.configurable); | 211 assertEquals(true, xlength.configurable); |
| 214 })(); | 212 })(); |
| OLD | NEW |