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

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
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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 353
354 if (c0_ == '"') { 354 if (c0_ == '"') {
355 // Successfully parsed index, parse and store element. 355 // Successfully parsed index, parse and store element.
356 AdvanceSkipWhitespace(); 356 AdvanceSkipWhitespace();
357 357
358 if (c0_ != ':') return ReportUnexpectedCharacter(); 358 if (c0_ != ':') return ReportUnexpectedCharacter();
359 AdvanceSkipWhitespace(); 359 AdvanceSkipWhitespace();
360 Handle<Object> value = ParseJsonValue(); 360 Handle<Object> value = ParseJsonValue();
361 if (value.is_null()) return ReportUnexpectedCharacter(); 361 if (value.is_null()) return ReportUnexpectedCharacter();
362 362
363 JSObject::SetOwnElement(json_object, index, value, SLOPPY); 363 JSObject::SetOwnElement(json_object, index, value, SLOPPY).Assert();
364 continue; 364 continue;
365 } 365 }
366 // Not an index, fallback to the slow path. 366 // Not an index, fallback to the slow path.
367 } 367 }
368 368
369 position_ = start_position; 369 position_ = start_position;
370 #ifdef DEBUG 370 #ifdef DEBUG
371 c0_ = '"'; 371 c0_ = '"';
372 #endif 372 #endif
373 373
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698