Chromium Code Reviews| Index: base/json/json_reader.cc |
| diff --git a/base/json/json_reader.cc b/base/json/json_reader.cc |
| index c9f6e76ffb6904d07afa6d5445bc49bac92eb472..e7c59602b7cb8514d9253cd3e48d0939fdf8c67a 100644 |
| --- a/base/json/json_reader.cc |
| +++ b/base/json/json_reader.cc |
| @@ -93,18 +93,24 @@ JSONReader::JSONReader() |
| error_col_(0) {} |
| // static |
| +Value* JSONReader::Read(const std::string& json) { |
| + return Read(json, JSON_PARSE_RFC); |
| +} |
| + |
| +// static |
| Value* JSONReader::Read(const std::string& json, |
| - bool allow_trailing_comma) { |
| - return ReadAndReturnError(json, allow_trailing_comma, NULL, NULL); |
| + JSONParserOptions options) { |
| + return ReadAndReturnError(json, options, NULL, NULL); |
| } |
| // static |
| Value* JSONReader::ReadAndReturnError(const std::string& json, |
| - bool allow_trailing_comma, |
| + JSONParserOptions options, |
| int* error_code_out, |
| std::string* error_msg_out) { |
| JSONReader reader = JSONReader(); |
| - Value* root = reader.JsonToValue(json, true, allow_trailing_comma); |
| + Value* root = reader.JsonToValue(json, false, |
|
Robert Sesek
2012/04/10 21:37:32
This (true -> false) is deliberate. The JSON parse
Mark Mentovai
2012/04/10 21:51:02
rsesek wrote:
|
| + (options & JSON_ALLOW_TRAILING_COMMAS) != 0); |
| if (root) |
| return root; |