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

Unified Diff: src/bootstrapper.cc

Issue 1062633002: Re-implement %Generator% intrinsic as an object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add TODO contact and bug URL Created 5 years, 8 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 | « no previous file | src/generator.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 3c957364fcbf92c8ed44637cf0209ece12968bd7..93ebb3f0fe5382b4908e865daf509d6b87e2a5ba 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2059,10 +2059,20 @@ bool Genesis::InstallNatives() {
Handle<JSObject> builtins(native_context()->builtins());
Handle<JSObject> generator_object_prototype =
factory()->NewJSObject(isolate()->object_function(), TENURED);
- Handle<JSFunction> generator_function_prototype =
- InstallFunction(builtins, "GeneratorFunctionPrototype",
- JS_FUNCTION_TYPE, JSFunction::kHeaderSize,
- generator_object_prototype, Builtins::kIllegal);
+ Handle<JSObject> generator_function_prototype =
+ factory()->NewJSObject(isolate()->object_function(), TENURED);
+ JSObject::AddProperty(
+ builtins,
+ factory()->InternalizeUtf8String("GeneratorFunctionPrototype"),
+ generator_function_prototype,
+ static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY));
+
+ JSObject::AddProperty(
+ generator_function_prototype,
+ factory()->InternalizeUtf8String("prototype"),
+ generator_object_prototype,
+ static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY));
+
InstallFunction(builtins, "GeneratorFunction", JS_FUNCTION_TYPE,
JSFunction::kSize, generator_function_prototype,
Builtins::kIllegal);
« no previous file with comments | « no previous file | src/generator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698