OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 352 |
353 if (c0_ == '"') { | 353 if (c0_ == '"') { |
354 // Successfully parsed index, parse and store element. | 354 // Successfully parsed index, parse and store element. |
355 AdvanceSkipWhitespace(); | 355 AdvanceSkipWhitespace(); |
356 | 356 |
357 if (c0_ != ':') return ReportUnexpectedCharacter(); | 357 if (c0_ != ':') return ReportUnexpectedCharacter(); |
358 AdvanceSkipWhitespace(); | 358 AdvanceSkipWhitespace(); |
359 Handle<Object> value = ParseJsonValue(); | 359 Handle<Object> value = ParseJsonValue(); |
360 if (value.is_null()) return ReportUnexpectedCharacter(); | 360 if (value.is_null()) return ReportUnexpectedCharacter(); |
361 | 361 |
362 JSObject::SetOwnElement(json_object, index, value, SLOPPY); | 362 JSObject::SetOwnElement(json_object, index, value, SLOPPY).Assert(); |
363 continue; | 363 continue; |
364 } | 364 } |
365 // Not an index, fallback to the slow path. | 365 // Not an index, fallback to the slow path. |
366 } | 366 } |
367 | 367 |
368 position_ = start_position; | 368 position_ = start_position; |
369 #ifdef DEBUG | 369 #ifdef DEBUG |
370 c0_ = '"'; | 370 c0_ = '"'; |
371 #endif | 371 #endif |
372 | 372 |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 | 797 |
798 ASSERT_EQ('"', c0_); | 798 ASSERT_EQ('"', c0_); |
799 // Advance past the last '"'. | 799 // Advance past the last '"'. |
800 AdvanceSkipWhitespace(); | 800 AdvanceSkipWhitespace(); |
801 return result; | 801 return result; |
802 } | 802 } |
803 | 803 |
804 } } // namespace v8::internal | 804 } } // namespace v8::internal |
805 | 805 |
806 #endif // V8_JSON_PARSER_H_ | 806 #endif // V8_JSON_PARSER_H_ |
OLD | NEW |