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

Unified Diff: src/factory.cc

Issue 14262004: Generator objects have [[Class]] === "Generator" (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Address review comments Created 7 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
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 5e2a2b18741507e4239bcfab8506712783a01c2c..01b885cafdb9d1b7ede7d9cf9d7289b707cee47c 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1078,6 +1078,7 @@ void Factory::SetIdentityHash(Handle<JSObject> object, Smi* hash) {
Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
Handle<String> name,
int number_of_literals,
+ bool is_generator,
Handle<Code> code,
Handle<ScopeInfo> scope_info) {
Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name);
@@ -1091,6 +1092,9 @@ Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
literals_array_size += JSFunction::kLiteralsPrefixSize;
}
shared->set_num_literals(literals_array_size);
+ if (is_generator) {
+ shared->set_instance_class_name(isolate()->heap()->Generator_string());
+ }
return shared;
}
« no previous file with comments | « src/factory.h ('k') | src/generator.js » ('j') | test/mjsunit/harmony/generators-objects.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698