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

Unified Diff: src/runtime/runtime-function.cc

Issue 1980463002: Fix %FunctionGetName and %_ClassOf for bound functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix %_ClassOf instead 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/full-codegen/x64/full-codegen-x64.cc ('k') | test/mjsunit/mirror-function.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | test/mjsunit/mirror-function.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698