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

Unified Diff: src/js/typedarray.js

Issue 1678123002: Extend subarray web compatibility fix to --harmony-species (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/regress/regress-4665-2.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/typedarray.js
diff --git a/src/js/typedarray.js b/src/js/typedarray.js
index 7becd8947a5a9161b1584d3f1e2bfd93a223d7d3..a3dfde3499b4e51b639d9927e3ced7bb81f18e9f 100644
--- a/src/js/typedarray.js
+++ b/src/js/typedarray.js
@@ -300,8 +300,10 @@ function NAMESubArray(begin, end) {
var newLength = endInt - beginInt;
var beginByteOffset =
%_ArrayBufferViewGetByteOffset(this) + beginInt * ELEMENT_SIZE;
- return TypedArraySpeciesCreate(this, %TypedArrayGetBuffer(this),
- beginByteOffset, newLength, true);
+ // BUG(v8:4665): For web compatibility, subarray needs to always build an
+ // instance of the default constructor.
+ // TODO(littledan): Switch to the standard or standardize the fix
+ return new GlobalNAME(%TypedArrayGetBuffer(this), beginByteOffset, newLength);
}
endmacro
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-4665-2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698