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 |