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

Side by Side Diff: src/json-parser.h

Issue 597893002: Version 3.28.71.12 (merged r24125) (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.28
Patch Set: move check to SetNormalizedProperty Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_JSON_PARSER_H_ 5 #ifndef V8_JSON_PARSER_H_
6 #define V8_JSON_PARSER_H_ 6 #define V8_JSON_PARSER_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/char-predicates-inl.h" 10 #include "src/char-predicates-inl.h"
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 } 417 }
418 } else { 418 } else {
419 key = ParseJsonInternalizedString(); 419 key = ParseJsonInternalizedString();
420 if (key.is_null() || c0_ != ':') return ReportUnexpectedCharacter(); 420 if (key.is_null() || c0_ != ':') return ReportUnexpectedCharacter();
421 421
422 AdvanceSkipWhitespace(); 422 AdvanceSkipWhitespace();
423 value = ParseJsonValue(); 423 value = ParseJsonValue();
424 if (value.is_null()) return ReportUnexpectedCharacter(); 424 if (value.is_null()) return ReportUnexpectedCharacter();
425 } 425 }
426 426
427 JSObject::SetOwnPropertyIgnoreAttributes( 427 Runtime::DefineObjectProperty(json_object, key, value, NONE).Check();
428 json_object, key, value, NONE).Assert();
429 } while (MatchSkipWhiteSpace(',')); 428 } while (MatchSkipWhiteSpace(','));
430 if (c0_ != '}') { 429 if (c0_ != '}') {
431 return ReportUnexpectedCharacter(); 430 return ReportUnexpectedCharacter();
432 } 431 }
433 432
434 // If we transitioned until the very end, transition the map now. 433 // If we transitioned until the very end, transition the map now.
435 if (transitioning) { 434 if (transitioning) {
436 JSObject::AllocateStorageForMap(json_object, map); 435 JSObject::AllocateStorageForMap(json_object, map);
437 int length = properties.length(); 436 int length = properties.length();
438 for (int i = 0; i < length; i++) { 437 for (int i = 0; i < length; i++) {
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 781
783 DCHECK_EQ('"', c0_); 782 DCHECK_EQ('"', c0_);
784 // Advance past the last '"'. 783 // Advance past the last '"'.
785 AdvanceSkipWhitespace(); 784 AdvanceSkipWhitespace();
786 return result; 785 return result;
787 } 786 }
788 787
789 } } // namespace v8::internal 788 } } // namespace v8::internal
790 789
791 #endif // V8_JSON_PARSER_H_ 790 #endif // V8_JSON_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698