| 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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 } else { | 435 } else { |
| 436 key = ParseJsonInternalizedString(); | 436 key = ParseJsonInternalizedString(); |
| 437 if (key.is_null() || c0_ != ':') return ReportUnexpectedCharacter(); | 437 if (key.is_null() || c0_ != ':') return ReportUnexpectedCharacter(); |
| 438 | 438 |
| 439 AdvanceSkipWhitespace(); | 439 AdvanceSkipWhitespace(); |
| 440 value = ParseJsonValue(); | 440 value = ParseJsonValue(); |
| 441 if (value.is_null()) return ReportUnexpectedCharacter(); | 441 if (value.is_null()) return ReportUnexpectedCharacter(); |
| 442 } | 442 } |
| 443 | 443 |
| 444 JSObject::SetLocalPropertyIgnoreAttributes( | 444 JSObject::SetLocalPropertyIgnoreAttributes( |
| 445 json_object, key, value, NONE); | 445 json_object, key, value, NONE).Assert(); |
| 446 } while (MatchSkipWhiteSpace(',')); | 446 } while (MatchSkipWhiteSpace(',')); |
| 447 if (c0_ != '}') { | 447 if (c0_ != '}') { |
| 448 return ReportUnexpectedCharacter(); | 448 return ReportUnexpectedCharacter(); |
| 449 } | 449 } |
| 450 | 450 |
| 451 // If we transitioned until the very end, transition the map now. | 451 // If we transitioned until the very end, transition the map now. |
| 452 if (transitioning) { | 452 if (transitioning) { |
| 453 JSObject::AllocateStorageForMap(json_object, map); | 453 JSObject::AllocateStorageForMap(json_object, map); |
| 454 int length = properties.length(); | 454 int length = properties.length(); |
| 455 for (int i = 0; i < length; i++) { | 455 for (int i = 0; i < length; i++) { |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 | 798 |
| 799 ASSERT_EQ('"', c0_); | 799 ASSERT_EQ('"', c0_); |
| 800 // Advance past the last '"'. | 800 // Advance past the last '"'. |
| 801 AdvanceSkipWhitespace(); | 801 AdvanceSkipWhitespace(); |
| 802 return result; | 802 return result; |
| 803 } | 803 } |
| 804 | 804 |
| 805 } } // namespace v8::internal | 805 } } // namespace v8::internal |
| 806 | 806 |
| 807 #endif // V8_JSON_PARSER_H_ | 807 #endif // V8_JSON_PARSER_H_ |
| OLD | NEW |