OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 (function(global, utils, extrasUtils) { | 5 (function(global, utils, extrasUtils) { |
6 | 6 |
7 "use strict"; | 7 "use strict"; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... | |
36 | 36 |
37 utils.ImportFromExperimental(function(from) { | 37 utils.ImportFromExperimental(function(from) { |
38 FLAG_harmony_species = from.FLAG_harmony_species; | 38 FLAG_harmony_species = from.FLAG_harmony_species; |
39 }); | 39 }); |
40 | 40 |
41 // ------------------------------------------------------------------- | 41 // ------------------------------------------------------------------- |
42 | 42 |
43 | 43 |
44 function ArraySpeciesCreate(array, length) { | 44 function ArraySpeciesCreate(array, length) { |
45 var constructor; | 45 var constructor; |
46 | |
47 if (1 / length === -INFINITY) { | |
48 length = 0; | |
49 } | |
Dan Ehrenberg
2016/05/04 16:44:48
A likely faster way to convert -0 to +0 is length
| |
50 | |
46 if (FLAG_harmony_species) { | 51 if (FLAG_harmony_species) { |
47 constructor = %ArraySpeciesConstructor(array); | 52 constructor = %ArraySpeciesConstructor(array); |
48 } else { | 53 } else { |
49 constructor = GlobalArray; | 54 constructor = GlobalArray; |
50 } | 55 } |
51 return new constructor(length); | 56 return new constructor(length); |
52 } | 57 } |
53 | 58 |
54 | 59 |
55 function KeySortCompare(a, b) { | 60 function KeySortCompare(a, b) { |
(...skipping 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1790 %InstallToContext([ | 1795 %InstallToContext([ |
1791 "array_pop", ArrayPop, | 1796 "array_pop", ArrayPop, |
1792 "array_push", ArrayPush, | 1797 "array_push", ArrayPush, |
1793 "array_shift", ArrayShift, | 1798 "array_shift", ArrayShift, |
1794 "array_splice", ArraySplice, | 1799 "array_splice", ArraySplice, |
1795 "array_slice", ArraySlice, | 1800 "array_slice", ArraySlice, |
1796 "array_unshift", ArrayUnshift, | 1801 "array_unshift", ArrayUnshift, |
1797 ]); | 1802 ]); |
1798 | 1803 |
1799 }); | 1804 }); |
OLD | NEW |