OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |