Index: src/array-iterator.js |
diff --git a/src/array-iterator.js b/src/array-iterator.js |
index 40e6e80ce658730b8fc7e73d6d5356bfe7cbdebd..a7cf0e390c2f9002eb990ea1b4b50977a6af7cb1 100644 |
--- a/src/array-iterator.js |
+++ b/src/array-iterator.js |
@@ -129,3 +129,30 @@ function ExtendArrayPrototype() { |
DONT_ENUM | DONT_DELETE | READ_ONLY); |
} |
ExtendArrayPrototype(); |
+ |
+ |
+function ExtendTypedArrayPrototypes() { |
+ %CheckIsBootstrapping(); |
+ |
+macro TYPED_ARRAYS(FUNCTION) |
+ FUNCTION(Uint8Array) |
+ FUNCTION(Int8Array) |
+ FUNCTION(Uint16Array) |
+ FUNCTION(Int16Array) |
+ FUNCTION(Uint32Array) |
+ FUNCTION(Int32Array) |
+ FUNCTION(Float32Array) |
+ FUNCTION(Float64Array) |
+ FUNCTION(Uint8ClampedArray) |
+endmacro |
+ |
+macro EXTEND_TYPED_ARRAY(NAME) |
+ %SetProperty(global.NAME.prototype, 'entries', ArrayEntries, DONT_ENUM); |
rossberg
2014/06/18 09:38:01
Why do you need. 'global.' here?
|
+ %SetProperty(global.NAME.prototype, 'values', ArrayValues, DONT_ENUM); |
+ %SetProperty(global.NAME.prototype, 'keys', ArrayKeys, DONT_ENUM); |
+ %SetProperty(global.NAME.prototype, symbolIterator, ArrayValues, DONT_ENUM); |
+endmacro |
+ |
+ TYPED_ARRAYS(EXTEND_TYPED_ARRAY) |
+} |
+ExtendTypedArrayPrototypes(); |