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

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

Issue 2006673002: Reduce boilerplace for common pattern to return MaybeHandle. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase and fix 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/runtime/runtime-operators.cc ('k') | src/runtime/runtime-regexp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-proxy.cc
diff --git a/src/runtime/runtime-proxy.cc b/src/runtime/runtime-proxy.cc
index 7764d25c5823d24ff880b32ad47a29d90877ee33..6a08dc1f35cf9cc1b806f1c819fc7e075441b872 100644
--- a/src/runtime/runtime-proxy.cc
+++ b/src/runtime/runtime-proxy.cc
@@ -46,11 +46,9 @@ RUNTIME_FUNCTION(Runtime_JSProxyCall) {
for (int i = 0; i < arguments_length; ++i) {
argv[i] = args.at<Object>(i + 1);
}
- Handle<Object> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result, Execution::Call(isolate, target, receiver,
- arguments_length, argv.start()));
- return *result;
+ RETURN_RESULT_OR_FAILURE(
+ isolate, Execution::Call(isolate, target, receiver, arguments_length,
+ argv.start()));
}
// 7. Let argArray be CreateArrayFromList(argumentsList).
Handle<JSArray> arg_array = isolate->factory()->NewJSArray(
@@ -63,12 +61,10 @@ RUNTIME_FUNCTION(Runtime_JSProxyCall) {
}
}
// 8. Return Call(trap, handler, «target, thisArgument, argArray»).
- Handle<Object> trap_result;
Handle<Object> trap_args[] = {target, receiver, arg_array};
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, trap_result,
+ RETURN_RESULT_OR_FAILURE(
+ isolate,
Execution::Call(isolate, trap, handler, arraysize(trap_args), trap_args));
- return *trap_result;
}
@@ -106,11 +102,9 @@ RUNTIME_FUNCTION(Runtime_JSProxyConstruct) {
for (int i = 0; i < arguments_length; ++i) {
argv[i] = args.at<Object>(i + 1);
}
- Handle<Object> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result, Execution::New(isolate, target, new_target,
- arguments_length, argv.start()));
- return *result;
+ RETURN_RESULT_OR_FAILURE(
+ isolate, Execution::New(isolate, target, new_target, arguments_length,
+ argv.start()));
}
// 7. Let argArray be CreateArrayFromList(argumentsList).
Handle<JSArray> arg_array = isolate->factory()->NewJSArray(
« no previous file with comments | « src/runtime/runtime-operators.cc ('k') | src/runtime/runtime-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698