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

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

Issue 177683002: Mode clean-up pt 1: rename classic/non-strict mode to sloppy mode (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 354
355 if (c0_ == '"') { 355 if (c0_ == '"') {
356 // Successfully parsed index, parse and store element. 356 // Successfully parsed index, parse and store element.
357 AdvanceSkipWhitespace(); 357 AdvanceSkipWhitespace();
358 358
359 if (c0_ != ':') return ReportUnexpectedCharacter(); 359 if (c0_ != ':') return ReportUnexpectedCharacter();
360 AdvanceSkipWhitespace(); 360 AdvanceSkipWhitespace();
361 Handle<Object> value = ParseJsonValue(); 361 Handle<Object> value = ParseJsonValue();
362 if (value.is_null()) return ReportUnexpectedCharacter(); 362 if (value.is_null()) return ReportUnexpectedCharacter();
363 363
364 JSObject::SetOwnElement(json_object, index, value, kNonStrictMode); 364 JSObject::SetOwnElement(json_object, index, value, kSloppyMode);
365 continue; 365 continue;
366 } 366 }
367 // Not an index, fallback to the slow path. 367 // Not an index, fallback to the slow path.
368 } 368 }
369 369
370 position_ = start_position; 370 position_ = start_position;
371 #ifdef DEBUG 371 #ifdef DEBUG
372 c0_ = '"'; 372 c0_ = '"';
373 #endif 373 #endif
374 374
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 800
801 ASSERT_EQ('"', c0_); 801 ASSERT_EQ('"', c0_);
802 // Advance past the last '"'. 802 // Advance past the last '"'.
803 AdvanceSkipWhitespace(); 803 AdvanceSkipWhitespace();
804 return result; 804 return result;
805 } 805 }
806 806
807 } } // namespace v8::internal 807 } } // namespace v8::internal
808 808
809 #endif // V8_JSON_PARSER_H_ 809 #endif // V8_JSON_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698