Index: src/js/array-iterator.js |
diff --git a/src/js/array-iterator.js b/src/js/array-iterator.js |
index 2609ebdd73622143eb78d298aa557b02707908d6..7170cba9148bb05472e05436b1112d4fb75e28f4 100644 |
--- a/src/js/array-iterator.js |
+++ b/src/js/array-iterator.js |
@@ -22,7 +22,24 @@ |
var iteratorSymbol = utils.ImportNow("iterator_symbol"); |
var MakeTypeError; |
var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); |
-var GlobalTypedArray = global.Uint8Array.__proto__; |
+ |
+macro TYPED_ARRAYS(FUNCTION) |
+ FUNCTION(Uint8Array) |
+ FUNCTION(Int8Array) |
+ FUNCTION(Uint16Array) |
+ FUNCTION(Int16Array) |
+ FUNCTION(Uint32Array) |
+ FUNCTION(Int32Array) |
+ FUNCTION(Float32Array) |
+ FUNCTION(Float64Array) |
+ FUNCTION(Uint8ClampedArray) |
+endmacro |
+ |
+macro COPY_FROM_GLOBAL(NAME) |
+ var GlobalNAME = global.NAME; |
+endmacro |
+ |
+TYPED_ARRAYS(COPY_FROM_GLOBAL) |
utils.Import(function(from) { |
MakeTypeError = from.MakeTypeError; |
@@ -135,12 +152,15 @@ |
%AddNamedProperty(GlobalArray.prototype, iteratorSymbol, ArrayValues, |
DONT_ENUM); |
-%AddNamedProperty(GlobalTypedArray.prototype, |
- 'entries', ArrayEntries, DONT_ENUM); |
-%AddNamedProperty(GlobalTypedArray.prototype, 'values', ArrayValues, DONT_ENUM); |
-%AddNamedProperty(GlobalTypedArray.prototype, 'keys', ArrayKeys, DONT_ENUM); |
-%AddNamedProperty(GlobalTypedArray.prototype, |
- iteratorSymbol, ArrayValues, DONT_ENUM); |
+macro EXTEND_TYPED_ARRAY(NAME) |
+ %AddNamedProperty(GlobalNAME.prototype, 'entries', ArrayEntries, DONT_ENUM); |
+ %AddNamedProperty(GlobalNAME.prototype, 'values', ArrayValues, DONT_ENUM); |
+ %AddNamedProperty(GlobalNAME.prototype, 'keys', ArrayKeys, DONT_ENUM); |
+ %AddNamedProperty(GlobalNAME.prototype, iteratorSymbol, ArrayValues, |
+ DONT_ENUM); |
+endmacro |
+ |
+TYPED_ARRAYS(EXTEND_TYPED_ARRAY) |
// ------------------------------------------------------------------- |
// Exports |