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

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

Issue 1316933002: [es6] Initial steps towards a correct implementation of IsCallable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: ia32, arm and arm64 ports. Misc cleanups. Created 5 years, 4 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
Index: src/runtime/runtime-function.cc
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc
index 31cda72874ee10b31cc7dc7dffdd99f91779d561..1d0668eec185d7b093f9008aa229d939cba33e1b 100644
--- a/src/runtime/runtime-function.cc
+++ b/src/runtime/runtime-function.cc
@@ -21,10 +21,10 @@ RUNTIME_FUNCTION(Runtime_IsSloppyModeFunction) {
CONVERT_ARG_CHECKED(JSReceiver, callable, 0);
if (!callable->IsJSFunction()) {
HandleScope scope(isolate);
- Handle<Object> delegate;
+ Handle<JSFunction> delegate;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, delegate, Execution::TryGetFunctionDelegate(
- isolate, Handle<JSReceiver>(callable)));
+ isolate, delegate,
+ Execution::GetFunctionDelegate(isolate, Handle<JSReceiver>(callable)));
callable = JSFunction::cast(*delegate);
}
JSFunction* function = JSFunction::cast(callable);
@@ -514,7 +514,7 @@ RUNTIME_FUNCTION(Runtime_NewObjectFromBound) {
if (!bound_function->IsJSFunction()) {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, bound_function,
- Execution::TryGetConstructorDelegate(isolate, bound_function));
+ Execution::GetConstructorDelegate(isolate, bound_function));
}
DCHECK(bound_function->IsJSFunction());
@@ -601,7 +601,10 @@ RUNTIME_FUNCTION(Runtime_GetFunctionDelegate) {
DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
RUNTIME_ASSERT(!object->IsJSFunction());
- return *Execution::GetFunctionDelegate(isolate, object);
+ Handle<JSFunction> result;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, result, Execution::GetFunctionDelegate(isolate, object));
+ return *result;
}
@@ -610,7 +613,10 @@ RUNTIME_FUNCTION(Runtime_GetConstructorDelegate) {
DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
RUNTIME_ASSERT(!object->IsJSFunction());
- return *Execution::GetConstructorDelegate(isolate, object);
+ Handle<JSFunction> result;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, result, Execution::GetConstructorDelegate(isolate, object));
+ return *result;
}

Powered by Google App Engine
This is Rietveld 408576698