Index: src/array-iterator.js |
diff --git a/src/array-iterator.js b/src/array-iterator.js |
index 10116b1d10b502c2079ce5e320db21b06ef60858..70eb610eb04dc69c7a4aebb4e513e0aec167bb6c 100644 |
--- a/src/array-iterator.js |
+++ b/src/array-iterator.js |
@@ -27,16 +27,20 @@ |
'use strict'; |
+ |
// This file relies on the fact that the following declaration has been made |
// in runtime.js: |
// var $Array = global.Array; |
+ |
var arrayIteratorObjectSymbol = GLOBAL_PRIVATE("ArrayIterator#object"); |
var arrayIteratorNextIndexSymbol = GLOBAL_PRIVATE("ArrayIterator#next"); |
var arrayIterationKindSymbol = GLOBAL_PRIVATE("ArrayIterator#kind"); |
+ |
function ArrayIterator() {} |
+ |
// 15.4.5.1 CreateArrayIterator Abstract Operation |
function CreateArrayIterator(array, kind) { |
var object = ToObject(array); |
@@ -47,11 +51,13 @@ function CreateArrayIterator(array, kind) { |
return iterator; |
} |
+ |
// 15.19.4.3.4 CreateItrResultObject |
function CreateIteratorResultObject(value, done) { |
return {value: value, done: done}; |
} |
+ |
// 15.4.5.2.2 ArrayIterator.prototype.next( ) |
function ArrayIteratorNext() { |
var iterator = ToObject(this); |
@@ -83,31 +89,35 @@ function ArrayIteratorNext() { |
return CreateIteratorResultObject(index, false); |
} |
+ |
function ArrayEntries() { |
return CreateArrayIterator(this, ITERATOR_KIND_ENTRIES); |
} |
+ |
function ArrayValues() { |
return CreateArrayIterator(this, ITERATOR_KIND_VALUES); |
} |
+ |
function ArrayKeys() { |
return CreateArrayIterator(this, ITERATOR_KIND_KEYS); |
} |
+ |
function SetUpArrayIterator() { |
%CheckIsBootstrapping(); |
+ delete ArrayIterator.prototype.constructor; |
arv (Not doing code reviews)
2014/04/25 16:45:30
I don't see where the constructor is added to this
arv (Not doing code reviews)
2014/04/28 21:12:54
Doh! The constructor is set by default for all fun
|
%FunctionSetInstanceClassName(ArrayIterator, 'Array Iterator'); |
- %FunctionSetReadOnlyPrototype(ArrayIterator); |
arv (Not doing code reviews)
2014/04/25 16:45:30
This is not in the spec and now there is no way to
|
InstallFunctions(ArrayIterator.prototype, DONT_ENUM, $Array( |
'next', ArrayIteratorNext |
)); |
} |
- |
SetUpArrayIterator(); |
+ |
function ExtendArrayPrototype() { |
%CheckIsBootstrapping(); |
@@ -117,5 +127,4 @@ function ExtendArrayPrototype() { |
'keys', ArrayKeys |
)); |
} |
- |
ExtendArrayPrototype(); |