Ben Murdoch | c561043 | 2016-08-08 18:44:38 +0100 | [diff] [blame^] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | /** |
| 6 | * 9.4.2.3 ArraySpeciesCreate(originalArray, length) |
| 7 | * |
| 8 | * 1. Assert: length is an integer Number ≥ 0. |
| 9 | * 2. If length is −0, let length be +0. |
| 10 | * [...] |
| 11 | */ |
| 12 | |
| 13 | var x = []; |
| 14 | var deleteCount; |
| 15 | |
| 16 | x.constructor = function() {}; |
| 17 | x.constructor[Symbol.species] = function(param) { |
| 18 | deleteCount = param; |
| 19 | }; |
| 20 | |
| 21 | x.splice(0, -0); |
| 22 | |
| 23 | assertEquals(0, deleteCount); |