Index: src/builtins.cc |
diff --git a/src/builtins.cc b/src/builtins.cc |
index 0fa87e36709f80b0c009f0d27ed008a49cabe70e..98f06af4b2eabc34c2809fdc735abb39ad43462c 100644 |
--- a/src/builtins.cc |
+++ b/src/builtins.cc |
@@ -376,14 +376,14 @@ MUST_USE_RESULT static MaybeObject* CallJsBuiltin( |
for (int i = 0; i < argc; ++i) { |
argv[i] = args.at<Object>(i + 1); |
} |
- bool pending_exception; |
- Handle<Object> result = Execution::Call(isolate, |
- function, |
- args.receiver(), |
- argc, |
- argv.start(), |
- &pending_exception); |
- if (pending_exception) return Failure::Exception(); |
+ Handle<Object> result; |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
+ isolate, result, |
+ Execution::Call(isolate, |
+ function, |
+ args.receiver(), |
+ argc, |
+ argv.start())); |
return *result; |
} |
@@ -1169,15 +1169,13 @@ MUST_USE_RESULT static MaybeObject* HandleApiCallHelper( |
Handle<JSFunction> function = args.called_function(); |
ASSERT(function->shared()->IsApiFunction()); |
- FunctionTemplateInfo* fun_data = function->shared()->get_api_func_data(); |
+ Handle<FunctionTemplateInfo> fun_data( |
+ function->shared()->get_api_func_data(), isolate); |
if (is_construct) { |
- Handle<FunctionTemplateInfo> desc(fun_data, isolate); |
- bool pending_exception = false; |
- isolate->factory()->ConfigureInstance( |
- desc, Handle<JSObject>::cast(args.receiver()), &pending_exception); |
- ASSERT(isolate->has_pending_exception() == pending_exception); |
- if (pending_exception) return Failure::Exception(); |
- fun_data = *desc; |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
+ isolate, fun_data, |
+ isolate->factory()->ConfigureInstance( |
+ fun_data, Handle<JSObject>::cast(args.receiver()))); |
} |
SharedFunctionInfo* shared = function->shared(); |
@@ -1189,7 +1187,7 @@ MUST_USE_RESULT static MaybeObject* HandleApiCallHelper( |
} |
} |
- Object* raw_holder = TypeCheck(heap, args.length(), &args[0], fun_data); |
+ Object* raw_holder = TypeCheck(heap, args.length(), &args[0], *fun_data); |
if (raw_holder->IsNull()) { |
// This function cannot be called with the given receiver. Abort! |