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

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

Issue 227573002: Return MaybeHandle from SetElement and DeleteElement. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 | « src/ic.cc ('k') | src/liveedit.h » ('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 // 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
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
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_
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | src/liveedit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698