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

Unified Diff: src/runtime/runtime-regexp.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-proxy.cc ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-regexp.cc
diff --git a/src/runtime/runtime-regexp.cc b/src/runtime/runtime-regexp.cc
index aead0171cee6a91c2e015e53ccdc1bb43daa8b53..37acc21845710e1271daf573e50e1fab7393a4a0 100644
--- a/src/runtime/runtime-regexp.cc
+++ b/src/runtime/runtime-regexp.cc
@@ -544,9 +544,7 @@ MUST_USE_RESULT static Object* StringReplaceGlobalRegExpWithString(
RegExpImpl::SetLastMatchInfo(last_match_info, subject, capture_count,
global_cache.LastSuccessfulMatch());
- Handle<String> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, builder.ToString());
- return *result;
+ RETURN_RESULT_OR_FAILURE(isolate, builder.ToString());
}
@@ -779,11 +777,8 @@ RUNTIME_FUNCTION(Runtime_RegExpExec) {
RUNTIME_ASSERT(index >= 0);
RUNTIME_ASSERT(index <= subject->length());
isolate->counters()->regexp_entry_runtime()->Increment();
- Handle<Object> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result,
- RegExpImpl::Exec(regexp, subject, index, last_match_info));
- return *result;
+ RETURN_RESULT_OR_FAILURE(
+ isolate, RegExpImpl::Exec(regexp, subject, index, last_match_info));
}
« no previous file with comments | « src/runtime/runtime-proxy.cc ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698