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

Unified Diff: src/collection-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/bootstrapper.cc ('k') | src/generator.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/collection-iterator.js
diff --git a/src/collection-iterator.js b/src/collection-iterator.js
index 7aa5208cea5bfc0a9b679cae37d0accdc335bc09..b48b85c1dca7eafa98d90269e6a31b46770b884f 100644
--- a/src/collection-iterator.js
+++ b/src/collection-iterator.js
@@ -14,7 +14,6 @@ var $setValues;
%CheckIsBootstrapping();
var GlobalMap = global.Map;
-var GlobalObject = global.Object;
var GlobalSet = global.Set;
// -------------------------------------------------------------------
@@ -49,11 +48,6 @@ function SetIteratorNextJS() {
}
-function SetIteratorSymbolIterator() {
- return this;
-}
-
-
function SetEntries() {
if (!IS_SET(this)) {
throw MakeTypeError(kIncompatibleMethodReceiver,
@@ -74,15 +68,12 @@ function SetValues() {
// -------------------------------------------------------------------
%SetCode(SetIterator, SetIteratorConstructor);
-%FunctionSetPrototype(SetIterator, new GlobalObject());
+%FunctionSetPrototype(SetIterator, {__proto__: $iteratorPrototype});
%FunctionSetInstanceClassName(SetIterator, 'Set Iterator');
$installFunctions(SetIterator.prototype, DONT_ENUM, [
'next', SetIteratorNextJS
]);
-$setFunctionName(SetIteratorSymbolIterator, symbolIterator);
-%AddNamedProperty(SetIterator.prototype, symbolIterator,
- SetIteratorSymbolIterator, DONT_ENUM);
%AddNamedProperty(SetIterator.prototype, symbolToStringTag,
"Set Iterator", READ_ONLY | DONT_ENUM);
@@ -104,11 +95,6 @@ function MapIteratorConstructor(map, kind) {
}
-function MapIteratorSymbolIterator() {
- return this;
-}
-
-
function MapIteratorNextJS() {
if (!IS_MAP_ITERATOR(this)) {
throw MakeTypeError(kIncompatibleMethodReceiver,
@@ -164,15 +150,12 @@ function MapValues() {
// -------------------------------------------------------------------
%SetCode(MapIterator, MapIteratorConstructor);
-%FunctionSetPrototype(MapIterator, new GlobalObject());
+%FunctionSetPrototype(MapIterator, {__proto__: $iteratorPrototype});
%FunctionSetInstanceClassName(MapIterator, 'Map Iterator');
$installFunctions(MapIterator.prototype, DONT_ENUM, [
'next', MapIteratorNextJS
]);
-$setFunctionName(MapIteratorSymbolIterator, symbolIterator);
-%AddNamedProperty(MapIterator.prototype, symbolIterator,
- MapIteratorSymbolIterator, DONT_ENUM);
%AddNamedProperty(MapIterator.prototype, symbolToStringTag,
"Map Iterator", READ_ONLY | DONT_ENUM);
« no previous file with comments | « src/bootstrapper.cc ('k') | src/generator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698