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

Unified Diff: src/runtime/runtime-json.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-date.cc ('k') | src/runtime/runtime-uri.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-json.cc
diff --git a/src/runtime/runtime-json.cc b/src/runtime/runtime-json.cc
index 07ccb9938fb5149850554d5ab1aebc2dfc300651..07232d59b8ba66c59d4d315dea0315f62bc9230a 100644
--- a/src/runtime/runtime-json.cc
+++ b/src/runtime/runtime-json.cc
@@ -39,9 +39,11 @@ RUNTIME_FUNCTION(Runtime_BasicJSONStringify) {
RUNTIME_FUNCTION(Runtime_ParseJson) {
HandleScope scope(isolate);
- DCHECK(args.length() == 1);
- CONVERT_ARG_HANDLE_CHECKED(String, source, 0);
-
+ DCHECK_EQ(1, args.length());
+ CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
+ Handle<String> source;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, source,
+ Object::ToString(isolate, object));
source = String::Flatten(source);
// Optimized fast case where we only have Latin1 characters.
Handle<Object> result;
@@ -51,5 +53,6 @@ RUNTIME_FUNCTION(Runtime_ParseJson) {
: JsonParser<false>::Parse(source));
return *result;
}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/runtime/runtime-date.cc ('k') | src/runtime/runtime-uri.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698