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

Unified Diff: src/bootstrapper.cc

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/array-iterator.js ('k') | src/collection-iterator.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index b1b18f8a0611a1cf7c5cafc318f6c6601b5d8da4..a61dd6beba48699c28159f9bdcc6b46154ab237b 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2129,10 +2129,17 @@ bool Genesis::InstallNatives() {
{
// Create generator meta-objects and install them on the builtins object.
Handle<JSObject> builtins(native_context()->builtins());
+ Handle<JSObject> iterator_prototype =
+ factory()->NewJSObject(isolate()->object_function(), TENURED);
Handle<JSObject> generator_object_prototype =
factory()->NewJSObject(isolate()->object_function(), TENURED);
Handle<JSObject> generator_function_prototype =
factory()->NewJSObject(isolate()->object_function(), TENURED);
+ SetObjectPrototype(generator_object_prototype, iterator_prototype);
+ JSObject::AddProperty(
+ builtins, factory()->InternalizeUtf8String("$iteratorPrototype"),
+ iterator_prototype,
+ static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY));
JSObject::AddProperty(
builtins,
factory()->InternalizeUtf8String("GeneratorFunctionPrototype"),
« no previous file with comments | « src/array-iterator.js ('k') | src/collection-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698