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

Unified Diff: src/js/typedarray.js

Issue 1780113002: Minor library function fixes for TypedArray spec compliance (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Improve comment Created 4 years, 9 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 | « src/js/array-iterator.js ('k') | test/mjsunit/es6/typed-array-iterator.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 b16dab2237f869a0645b114a75e0aa3949fc68f1..e1772583803fe6b3a9a7ffb02e1afc0ced707d79 100644
--- a/src/js/typedarray.js
+++ b/src/js/typedarray.js
@@ -12,7 +12,8 @@
// Imports
var AddIndexedProperty;
-var ArrayToString;
+// array.js has to come before typedarray.js for this to work
+var ArrayToString = utils.ImportNow("ArrayToString");
var ArrayValues;
var GetIterator;
var GetMethod;
@@ -71,7 +72,6 @@ TYPED_ARRAYS(DECLARE_GLOBALS)
utils.Import(function(from) {
AddIndexedProperty = from.AddIndexedProperty;
- ArrayToString = from.ArrayToString;
ArrayValues = from.ArrayValues;
GetIterator = from.GetIterator;
GetMethod = from.GetMethod;
@@ -684,12 +684,6 @@ function TypedArrayToLocaleString() {
}
-// ES6 section 22.2.3.28
-function TypedArrayToString() {
- return %_Call(ArrayToString, this);
-}
-
-
// ES6 section 22.2.3.14
function TypedArrayJoin(separator) {
if (!IS_TYPEDARRAY(this)) throw MakeTypeError(kNotTypedArray);
@@ -882,10 +876,12 @@ utils.InstallFunctions(TypedArray.prototype, DONT_ENUM, [
"slice", TypedArraySlice,
"some", TypedArraySome,
"sort", TypedArraySort,
- "toString", TypedArrayToString,
"toLocaleString", TypedArrayToLocaleString
]);
+%AddNamedProperty(TypedArray.prototype, "toString", ArrayToString,
+ DONT_ENUM);
+
macro SETUP_TYPED_ARRAY(ARRAY_ID, NAME, ELEMENT_SIZE)
%SetCode(GlobalNAME, NAMEConstructor);
« no previous file with comments | « src/js/array-iterator.js ('k') | test/mjsunit/es6/typed-array-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698