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

Unified Diff: src/js/array.js

Issue 2058013002: Array.prototype.slice should only normalize result if it's an array (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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
Index: src/js/array.js
diff --git a/src/js/array.js b/src/js/array.js
index 633a8a255ffdd2bdb2a1d69db92206fe11417a3e..671e507a1568bed82f41a6b1f7040c6493e6c867 100644
--- a/src/js/array.js
+++ b/src/js/array.js
@@ -659,7 +659,7 @@ function ArraySlice(start, end) {
if (UseSparseVariant(array, len, IS_ARRAY(array), end_i - start_i)) {
%NormalizeElements(array);
- %NormalizeElements(result);
+ if (IS_ARRAY(result)) %NormalizeElements(result);
SparseSlice(array, start_i, end_i - start_i, len, result);
} else {
SimpleSlice(array, start_i, end_i - start_i, len, result);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-618788.js » ('j') | test/mjsunit/regress/regress-crbug-618788.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698