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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/es6/array-species-neg-zero.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/array.js
diff --git a/src/js/array.js b/src/js/array.js
index 8c1a0aefa66bcc82ab154b7ab43723f58b284d24..82b4040d600969feca4207425e7bd1ef3b24889e 100644
--- a/src/js/array.js
+++ b/src/js/array.js
@@ -43,6 +43,11 @@ utils.ImportFromExperimental(function(from) {
function ArraySpeciesCreate(array, length) {
var constructor;
+
+ if (1 / length === -INFINITY) {
+ length = 0;
+ }
Dan Ehrenberg 2016/05/04 16:44:48 A likely faster way to convert -0 to +0 is length
+
if (FLAG_harmony_species) {
constructor = %ArraySpeciesConstructor(array);
} else {
« 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