| 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 case '9': | 221 case '9': |
| 222 message = "unexpected_token_number"; | 222 message = "unexpected_token_number"; |
| 223 array = factory->NewJSArray(0); | 223 array = factory->NewJSArray(0); |
| 224 break; | 224 break; |
| 225 case '"': | 225 case '"': |
| 226 message = "unexpected_token_string"; | 226 message = "unexpected_token_string"; |
| 227 array = factory->NewJSArray(0); | 227 array = factory->NewJSArray(0); |
| 228 break; | 228 break; |
| 229 default: | 229 default: |
| 230 message = "unexpected_token"; | 230 message = "unexpected_token"; |
| 231 Handle<Object> name = LookupSingleCharacterStringFromCode(c0_); | 231 Handle<Object> name = |
| 232 LookupSingleCharacterStringFromCode(isolate_, c0_); |
| 232 Handle<FixedArray> element = factory->NewFixedArray(1); | 233 Handle<FixedArray> element = factory->NewFixedArray(1); |
| 233 element->set(0, *name); | 234 element->set(0, *name); |
| 234 array = factory->NewJSArrayWithElements(element); | 235 array = factory->NewJSArrayWithElements(element); |
| 235 break; | 236 break; |
| 236 } | 237 } |
| 237 | 238 |
| 238 MessageLocation location(factory->NewScript(source), | 239 MessageLocation location(factory->NewScript(source), |
| 239 position_, | 240 position_, |
| 240 position_ + 1); | 241 position_ + 1); |
| 241 Handle<Object> result = factory->NewSyntaxError(message, array); | 242 Handle<Object> result = factory->NewSyntaxError(message, array); |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 } | 705 } |
| 705 ASSERT_EQ('"', c0_); | 706 ASSERT_EQ('"', c0_); |
| 706 // Advance past the last '"'. | 707 // Advance past the last '"'. |
| 707 AdvanceSkipWhitespace(); | 708 AdvanceSkipWhitespace(); |
| 708 return result; | 709 return result; |
| 709 } | 710 } |
| 710 | 711 |
| 711 } } // namespace v8::internal | 712 } } // namespace v8::internal |
| 712 | 713 |
| 713 #endif // V8_JSON_PARSER_H_ | 714 #endif // V8_JSON_PARSER_H_ |
| OLD | NEW |