Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: src/js/array.js

Issue 1950073002: Convert negative zero in ArraySpeciesCreate (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/es6/array-species-neg-zero.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 });
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es6/array-species-neg-zero.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698