Index: src/runtime/runtime-function.cc |
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc |
index 7d7b81109284cc88a597d2f05214076fe26aca17..56cf3b6dcbd8c371364bb256cf411277afae868d 100644 |
--- a/src/runtime/runtime-function.cc |
+++ b/src/runtime/runtime-function.cc |
@@ -17,11 +17,19 @@ namespace v8 { |
namespace internal { |
RUNTIME_FUNCTION(Runtime_FunctionGetName) { |
- SealHandleScope shs(isolate); |
+ HandleScope scope(isolate); |
DCHECK(args.length() == 1); |
- CONVERT_ARG_CHECKED(JSFunction, f, 0); |
- return f->shared()->name(); |
+ CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0); |
+ Handle<Object> result; |
+ if (function->IsJSBoundFunction()) { |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
+ isolate, result, JSBoundFunction::GetName( |
+ isolate, Handle<JSBoundFunction>::cast(function))); |
+ } else { |
+ result = JSFunction::GetName(isolate, Handle<JSFunction>::cast(function)); |
+ } |
+ return *result; |
} |