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

Unified Diff: src/runtime/runtime-uri.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-symbol.cc ('k') | src/uri.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-uri.cc
diff --git a/src/runtime/runtime-uri.cc b/src/runtime/runtime-uri.cc
index e64e9dcea7cb26d83affa4b61305f4351c2b6ed1..2729225fc39838cb1266f1b4c20ffd36aeb7d256 100644
--- a/src/runtime/runtime-uri.cc
+++ b/src/runtime/runtime-uri.cc
@@ -264,12 +264,10 @@ RUNTIME_FUNCTION(Runtime_URIEscape) {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, source,
Object::ToString(isolate, input));
source = String::Flatten(source);
- Handle<String> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result, source->IsOneByteRepresentationUnderneath()
- ? URIEscape::Escape<uint8_t>(isolate, source)
- : URIEscape::Escape<uc16>(isolate, source));
- return *result;
+ RETURN_RESULT_OR_FAILURE(isolate,
+ source->IsOneByteRepresentationUnderneath()
+ ? URIEscape::Escape<uint8_t>(isolate, source)
+ : URIEscape::Escape<uc16>(isolate, source));
}
@@ -281,12 +279,10 @@ RUNTIME_FUNCTION(Runtime_URIUnescape) {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, source,
Object::ToString(isolate, input));
source = String::Flatten(source);
- Handle<String> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result, source->IsOneByteRepresentationUnderneath()
- ? URIUnescape::Unescape<uint8_t>(isolate, source)
- : URIUnescape::Unescape<uc16>(isolate, source));
- return *result;
+ RETURN_RESULT_OR_FAILURE(isolate,
+ source->IsOneByteRepresentationUnderneath()
+ ? URIUnescape::Unescape<uint8_t>(isolate, source)
+ : URIUnescape::Unescape<uc16>(isolate, source));
}
} // namespace internal
« no previous file with comments | « src/runtime/runtime-symbol.cc ('k') | src/uri.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698