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); |