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

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

Issue 1323543002: [runtime] Replace %to_string_fun with %_ToString. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@ToStringStub
Patch Set: REBASE. Fixes Created 5 years, 3 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-json.cc ('k') | src/string.js » ('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 d4e62ce4d23f35f5ce94ecf1855c76e18a87777f..e64e9dcea7cb26d83affa4b61305f4351c2b6ed1 100644
--- a/src/runtime/runtime-uri.cc
+++ b/src/runtime/runtime-uri.cc
@@ -258,13 +258,15 @@ MaybeHandle<String> URIEscape::Escape(Isolate* isolate, Handle<String> string) {
RUNTIME_FUNCTION(Runtime_URIEscape) {
HandleScope scope(isolate);
- DCHECK(args.length() == 1);
- CONVERT_ARG_HANDLE_CHECKED(String, source, 0);
- Handle<String> string = String::Flatten(source);
- DCHECK(string->IsFlat());
+ DCHECK_EQ(1, args.length());
+ CONVERT_ARG_HANDLE_CHECKED(Object, input, 0);
+ Handle<String> source;
+ 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, string->IsOneByteRepresentationUnderneath()
+ isolate, result, source->IsOneByteRepresentationUnderneath()
? URIEscape::Escape<uint8_t>(isolate, source)
: URIEscape::Escape<uc16>(isolate, source));
return *result;
@@ -274,15 +276,18 @@ RUNTIME_FUNCTION(Runtime_URIEscape) {
RUNTIME_FUNCTION(Runtime_URIUnescape) {
HandleScope scope(isolate);
DCHECK(args.length() == 1);
- CONVERT_ARG_HANDLE_CHECKED(String, source, 0);
- Handle<String> string = String::Flatten(source);
- DCHECK(string->IsFlat());
+ CONVERT_ARG_HANDLE_CHECKED(Object, input, 0);
+ Handle<String> source;
+ 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, string->IsOneByteRepresentationUnderneath()
+ isolate, result, source->IsOneByteRepresentationUnderneath()
? URIUnescape::Unescape<uint8_t>(isolate, source)
: URIUnescape::Unescape<uc16>(isolate, source));
return *result;
}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/runtime/runtime-json.cc ('k') | src/string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698