Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 2130e6ca939dad2dcc88a6dcd90f60ed27e06c70..2457fd8c3927643c3bc99a783126a4eb244703d1 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -5223,6 +5223,17 @@ MaybeHandle<String> JSBoundFunction::GetName(Isolate* isolate, |
} |
// static |
+Handle<Object> JSFunction::GetPrototype(Isolate* isolate, |
+ Handle<JSFunction> function) { |
+ DCHECK(function->IsConstructor() || function->shared()->is_generator()); |
+ if (!function->has_prototype()) { |
+ Handle<Object> proto = isolate->factory()->NewFunctionPrototype(function); |
+ JSFunction::SetPrototype(function, proto); |
+ } |
+ return handle(function->prototype(), isolate); |
+} |
+ |
+// static |
Handle<Object> JSFunction::GetName(Isolate* isolate, |
Handle<JSFunction> function) { |
if (function->shared()->name_should_print_as_anonymous()) { |