Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Unified Diff: src/string-iterator.js

Issue 1325023003: [es6] Fix invalid ToObject in String/Array iterator next. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/array-iterator.js ('K') | « src/array-iterator.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string-iterator.js
diff --git a/src/string-iterator.js b/src/string-iterator.js
index c55d967d78d4bcc08d755ce86b23672de1e2d5d5..42ddb2391f7470c437df49e6caf577272d8b70b3 100644
--- a/src/string-iterator.js
+++ b/src/string-iterator.js
@@ -41,9 +41,10 @@ function CreateStringIterator(string) {
// 21.1.5.2.1 %StringIteratorPrototype%.next( )
function StringIteratorNext() {
- var iterator = TO_OBJECT(this);
+ var iterator = this;
- if (!HAS_DEFINED_PRIVATE(iterator, stringIteratorNextIndexSymbol)) {
+ if (!IS_SPEC_OBJECT(iterator) ||
+ !HAS_DEFINED_PRIVATE(iterator, stringIteratorNextIndexSymbol)) {
throw MakeTypeError(kIncompatibleMethodReceiver,
'String Iterator.prototype.next');
}
« src/array-iterator.js ('K') | « src/array-iterator.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698