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

Unified Diff: src/string-iterator.js

Issue 1128233008: [es6] Iterators and generators should "extend" %IteratorPrototype% (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add missing files Created 5 years, 7 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
« no previous file with comments | « src/iterator-prototype.js ('k') | test/mjsunit/es6/generators-runtime.js » ('j') | 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 c19e808020cee52355bfbfcf28bbd37fd72ee4ef..82493562558a191e0d1ad2cf5df2277f6ac67b10 100644
--- a/src/string-iterator.js
+++ b/src/string-iterator.js
@@ -8,7 +8,6 @@
%CheckIsBootstrapping();
-var GlobalObject = global.Object;
var GlobalString = global.String;
//-------------------------------------------------------------------
@@ -31,12 +30,6 @@ function CreateStringIterator(string) {
}
-// 21.1.5.2.2 %StringIteratorPrototype%[@@iterator]
-function StringIteratorIterator() {
- return this;
-}
-
-
// 21.1.5.2.1 %StringIteratorPrototype%.next( )
function StringIteratorNext() {
var iterator = $toObject(this);
@@ -85,15 +78,12 @@ function StringPrototypeIterator() {
//-------------------------------------------------------------------
-%FunctionSetPrototype(StringIterator, new GlobalObject());
+%FunctionSetPrototype(StringIterator, {__proto__: $iteratorPrototype});
%FunctionSetInstanceClassName(StringIterator, 'String Iterator');
$installFunctions(StringIterator.prototype, DONT_ENUM, [
'next', StringIteratorNext
]);
-$setFunctionName(StringIteratorIterator, symbolIterator);
-%AddNamedProperty(StringIterator.prototype, symbolIterator,
- StringIteratorIterator, DONT_ENUM);
%AddNamedProperty(StringIterator.prototype, symbolToStringTag,
"String Iterator", READ_ONLY | DONT_ENUM);
« no previous file with comments | « src/iterator-prototype.js ('k') | test/mjsunit/es6/generators-runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698