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

Unified Diff: src/json-parser.h

Issue 223553003: Return MaybeHandle from JsonParser. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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/api.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-parser.h
diff --git a/src/json-parser.h b/src/json-parser.h
index ca21421d44838ccdd4e23771d9da4679f51483d6..ca937a0968f45444ad93213d885f524e4334daf0 100644
--- a/src/json-parser.h
+++ b/src/json-parser.h
@@ -43,7 +43,7 @@ namespace internal {
template <bool seq_ascii>
class JsonParser BASE_EMBEDDED {
public:
- static Handle<Object> Parse(Handle<String> source) {
+ static MaybeHandle<Object> Parse(Handle<String> source) {
return JsonParser(source).ParseJson();
}
@@ -69,7 +69,7 @@ class JsonParser BASE_EMBEDDED {
}
// Parse a string containing a single JSON value.
- Handle<Object> ParseJson();
+ MaybeHandle<Object> ParseJson();
inline void Advance() {
position_++;
@@ -219,7 +219,7 @@ class JsonParser BASE_EMBEDDED {
};
template <bool seq_ascii>
-Handle<Object> JsonParser<seq_ascii>::ParseJson() {
+MaybeHandle<Object> JsonParser<seq_ascii>::ParseJson() {
// Advance to the first character (possibly EOS)
AdvanceSkipWhitespace();
Handle<Object> result = ParseJsonValue();
@@ -268,9 +268,8 @@ Handle<Object> JsonParser<seq_ascii>::ParseJson() {
MessageLocation location(factory->NewScript(source_),
position_,
position_ + 1);
- Handle<Object> result = factory->NewSyntaxError(message, array);
- isolate()->Throw(*result, &location);
- return Handle<Object>::null();
+ Handle<Object> error = factory->NewSyntaxError(message, array);
+ return isolate()->template Throw<Object>(error, &location);
}
return result;
}
« no previous file with comments | « src/api.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698