OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 (function(global, utils) { | 5 (function(global, utils) { |
6 | 6 |
7 "use strict"; | 7 "use strict"; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 return this; | 71 return this; |
72 } | 72 } |
73 | 73 |
74 | 74 |
75 // ES6 section 22.1.5.2.1 %ArrayIteratorPrototype%.next( ) | 75 // ES6 section 22.1.5.2.1 %ArrayIteratorPrototype%.next( ) |
76 function ArrayIteratorNext() { | 76 function ArrayIteratorNext() { |
77 var iterator = this; | 77 var iterator = this; |
78 var value = UNDEFINED; | 78 var value = UNDEFINED; |
79 var done = true; | 79 var done = true; |
80 | 80 |
81 if (!IS_SPEC_OBJECT(iterator) || | 81 if (!IS_RECEIVER(iterator) || |
82 !HAS_DEFINED_PRIVATE(iterator, arrayIteratorNextIndexSymbol)) { | 82 !HAS_DEFINED_PRIVATE(iterator, arrayIteratorNextIndexSymbol)) { |
83 throw MakeTypeError(kIncompatibleMethodReceiver, | 83 throw MakeTypeError(kIncompatibleMethodReceiver, |
84 'Array Iterator.prototype.next', this); | 84 'Array Iterator.prototype.next', this); |
85 } | 85 } |
86 | 86 |
87 var array = GET_PRIVATE(iterator, arrayIteratorObjectSymbol); | 87 var array = GET_PRIVATE(iterator, arrayIteratorObjectSymbol); |
88 if (!IS_UNDEFINED(array)) { | 88 if (!IS_UNDEFINED(array)) { |
89 var index = GET_PRIVATE(iterator, arrayIteratorNextIndexSymbol); | 89 var index = GET_PRIVATE(iterator, arrayIteratorNextIndexSymbol); |
90 var itemKind = GET_PRIVATE(iterator, arrayIterationKindSymbol); | 90 var itemKind = GET_PRIVATE(iterator, arrayIterationKindSymbol); |
91 var length = TO_UINT32(array.length); | 91 var length = TO_UINT32(array.length); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 // ------------------------------------------------------------------- | 165 // ------------------------------------------------------------------- |
166 // Exports | 166 // Exports |
167 | 167 |
168 utils.Export(function(to) { | 168 utils.Export(function(to) { |
169 to.ArrayValues = ArrayValues; | 169 to.ArrayValues = ArrayValues; |
170 }); | 170 }); |
171 | 171 |
172 %InstallToContext(["array_values_iterator", ArrayValues]); | 172 %InstallToContext(["array_values_iterator", ArrayValues]); |
173 | 173 |
174 }) | 174 }) |
OLD | NEW |