Index: src/runtime/runtime-json.cc |
diff --git a/src/runtime/runtime-json.cc b/src/runtime/runtime-json.cc |
index d953eeb40425b9fc4fd80a84b90eb074d721c8a8..576e5400927d1cf37c56fa68b70f96aa305bdf24 100644 |
--- a/src/runtime/runtime-json.cc |
+++ b/src/runtime/runtime-json.cc |
@@ -18,10 +18,8 @@ RUNTIME_FUNCTION(Runtime_QuoteJSONString) { |
HandleScope scope(isolate); |
CONVERT_ARG_HANDLE_CHECKED(String, string, 0); |
DCHECK(args.length() == 1); |
- Handle<Object> result; |
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
- isolate, result, BasicJsonStringifier::StringifyString(isolate, string)); |
- return *result; |
+ RETURN_RESULT_OR_FAILURE( |
+ isolate, BasicJsonStringifier::StringifyString(isolate, string)); |
} |
RUNTIME_FUNCTION(Runtime_BasicJSONStringify) { |
@@ -29,10 +27,8 @@ RUNTIME_FUNCTION(Runtime_BasicJSONStringify) { |
DCHECK(args.length() == 2); |
CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
CONVERT_ARG_HANDLE_CHECKED(Object, gap, 1); |
- Handle<Object> result; |
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
- isolate, result, BasicJsonStringifier(isolate).Stringify(object, gap)); |
- return *result; |
+ RETURN_RESULT_OR_FAILURE( |
+ isolate, BasicJsonStringifier(isolate).Stringify(object, gap)); |
} |
RUNTIME_FUNCTION(Runtime_ParseJson) { |
@@ -44,12 +40,9 @@ RUNTIME_FUNCTION(Runtime_ParseJson) { |
Object::ToString(isolate, object)); |
source = String::Flatten(source); |
// Optimized fast case where we only have Latin1 characters. |
- Handle<Object> result; |
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
- source->IsSeqOneByteString() |
- ? JsonParser<true>::Parse(source) |
- : JsonParser<false>::Parse(source)); |
- return *result; |
+ RETURN_RESULT_OR_FAILURE(isolate, source->IsSeqOneByteString() |
+ ? JsonParser<true>::Parse(source) |
+ : JsonParser<false>::Parse(source)); |
} |
} // namespace internal |