OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Based on: https://hg.mozilla.org/mozilla-central/file/d0c3168c3c47/js/src/jit
-test/tests/collections/Array-of-generic-2.js |
| 6 |
| 7 // Flags: --harmony-arrays |
| 8 |
| 9 |
| 10 // Array.of passes the number of arguments to the constructor it calls. |
| 11 |
| 12 var hits = 0; |
| 13 |
| 14 function Herd(n) { |
| 15 assertEquals(arguments.length, 1); |
| 16 assertEquals(n, 5); |
| 17 hits++; |
| 18 } |
| 19 |
| 20 Herd.of = Array.of; |
| 21 Herd.of("sheep", "cattle", "elephants", "whales", "seals"); |
| 22 assertEquals(hits, 1); |
OLD | NEW |