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); |