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

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

Issue 227593004: Handlify LookupSingleCharacterStringFromCode. (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/hydrogen-instructions.cc ('k') | src/runtime.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 // 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 case '9': 250 case '9':
251 message = "unexpected_token_number"; 251 message = "unexpected_token_number";
252 array = factory->NewJSArray(0); 252 array = factory->NewJSArray(0);
253 break; 253 break;
254 case '"': 254 case '"':
255 message = "unexpected_token_string"; 255 message = "unexpected_token_string";
256 array = factory->NewJSArray(0); 256 array = factory->NewJSArray(0);
257 break; 257 break;
258 default: 258 default:
259 message = "unexpected_token"; 259 message = "unexpected_token";
260 Handle<Object> name = 260 Handle<Object> name = factory->LookupSingleCharacterStringFromCode(c0_);
261 LookupSingleCharacterStringFromCode(isolate_, c0_);
262 Handle<FixedArray> element = factory->NewFixedArray(1); 261 Handle<FixedArray> element = factory->NewFixedArray(1);
263 element->set(0, *name); 262 element->set(0, *name);
264 array = factory->NewJSArrayWithElements(element); 263 array = factory->NewJSArrayWithElements(element);
265 break; 264 break;
266 } 265 }
267 266
268 MessageLocation location(factory->NewScript(source_), 267 MessageLocation location(factory->NewScript(source_),
269 position_, 268 position_,
270 position_ + 1); 269 position_ + 1);
271 Handle<Object> error = factory->NewSyntaxError(message, array); 270 Handle<Object> error = factory->NewSyntaxError(message, array);
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 797
799 ASSERT_EQ('"', c0_); 798 ASSERT_EQ('"', c0_);
800 // Advance past the last '"'. 799 // Advance past the last '"'.
801 AdvanceSkipWhitespace(); 800 AdvanceSkipWhitespace();
802 return result; 801 return result;
803 } 802 }
804 803
805 } } // namespace v8::internal 804 } } // namespace v8::internal
806 805
807 #endif // V8_JSON_PARSER_H_ 806 #endif // V8_JSON_PARSER_H_
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698