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

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

Issue 592813002: Fix escaped index JSON parsing (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 | test/mjsunit/regress/regress-json-parse-index.js » ('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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 } 419 }
420 } else { 420 } else {
421 key = ParseJsonInternalizedString(); 421 key = ParseJsonInternalizedString();
422 if (key.is_null() || c0_ != ':') return ReportUnexpectedCharacter(); 422 if (key.is_null() || c0_ != ':') return ReportUnexpectedCharacter();
423 423
424 AdvanceSkipWhitespace(); 424 AdvanceSkipWhitespace();
425 value = ParseJsonValue(); 425 value = ParseJsonValue();
426 if (value.is_null()) return ReportUnexpectedCharacter(); 426 if (value.is_null()) return ReportUnexpectedCharacter();
427 } 427 }
428 428
429 JSObject::SetOwnPropertyIgnoreAttributes( 429 Runtime::DefineObjectProperty(json_object, key, value, NONE).Check();
430 json_object, key, value, NONE).Assert();
431 } while (MatchSkipWhiteSpace(',')); 430 } while (MatchSkipWhiteSpace(','));
432 if (c0_ != '}') { 431 if (c0_ != '}') {
433 return ReportUnexpectedCharacter(); 432 return ReportUnexpectedCharacter();
434 } 433 }
435 434
436 // If we transitioned until the very end, transition the map now. 435 // If we transitioned until the very end, transition the map now.
437 if (transitioning) { 436 if (transitioning) {
438 JSObject::AllocateStorageForMap(json_object, map); 437 JSObject::AllocateStorageForMap(json_object, map);
439 int length = properties.length(); 438 int length = properties.length();
440 for (int i = 0; i < length; i++) { 439 for (int i = 0; i < length; i++) {
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 783
785 DCHECK_EQ('"', c0_); 784 DCHECK_EQ('"', c0_);
786 // Advance past the last '"'. 785 // Advance past the last '"'.
787 AdvanceSkipWhitespace(); 786 AdvanceSkipWhitespace();
788 return result; 787 return result;
789 } 788 }
790 789
791 } } // namespace v8::internal 790 } } // namespace v8::internal
792 791
793 #endif // V8_JSON_PARSER_H_ 792 #endif // V8_JSON_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-json-parse-index.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698