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

Unified Diff: src/objects.cc

Issue 1982203003: [runtime] Fix effect of setting .prototype on generator functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: ignition test rebaseline Created 4 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/contexts.h ('k') | test/cctest/interpreter/bytecode_expectations/CallRuntime.golden » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 258f9aea2c167e6b1ae9caf18fb7062f774ef09e..7c97c40f1b00a3ce0c7cb6fc15a0851cc5f73c1b 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -11825,8 +11825,13 @@ void JSFunction::SetPrototype(Handle<JSFunction> function,
new_map->SetConstructor(*value);
new_map->set_non_instance_prototype(true);
Isolate* isolate = new_map->GetIsolate();
+
construct_prototype = handle(
- function->context()->native_context()->initial_object_prototype(),
+ IsGeneratorFunction(function->shared()->kind())
+ ? function->context()
+ ->native_context()
+ ->initial_generator_prototype()
+ : function->context()->native_context()->initial_object_prototype(),
isolate);
} else {
function->map()->set_non_instance_prototype(false);
« no previous file with comments | « src/contexts.h ('k') | test/cctest/interpreter/bytecode_expectations/CallRuntime.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698