| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_JSON_PARSER_H_ | 5 #ifndef V8_JSON_PARSER_H_ |
| 6 #define V8_JSON_PARSER_H_ | 6 #define V8_JSON_PARSER_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/char-predicates-inl.h" | 10 #include "src/char-predicates-inl.h" |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 Advance(); | 521 Advance(); |
| 522 } while (c0_ >= '0' && c0_ <= '9'); | 522 } while (c0_ >= '0' && c0_ <= '9'); |
| 523 } | 523 } |
| 524 int length = position_ - beg_pos; | 524 int length = position_ - beg_pos; |
| 525 double number; | 525 double number; |
| 526 if (seq_ascii) { | 526 if (seq_ascii) { |
| 527 Vector<const uint8_t> chars(seq_source_->GetChars() + beg_pos, length); | 527 Vector<const uint8_t> chars(seq_source_->GetChars() + beg_pos, length); |
| 528 number = StringToDouble(isolate()->unicode_cache(), | 528 number = StringToDouble(isolate()->unicode_cache(), |
| 529 chars, | 529 chars, |
| 530 NO_FLAGS, // Hex, octal or trailing junk. | 530 NO_FLAGS, // Hex, octal or trailing junk. |
| 531 OS::nan_value()); | 531 base::OS::nan_value()); |
| 532 } else { | 532 } else { |
| 533 Vector<uint8_t> buffer = Vector<uint8_t>::New(length); | 533 Vector<uint8_t> buffer = Vector<uint8_t>::New(length); |
| 534 String::WriteToFlat(*source_, buffer.start(), beg_pos, position_); | 534 String::WriteToFlat(*source_, buffer.start(), beg_pos, position_); |
| 535 Vector<const uint8_t> result = | 535 Vector<const uint8_t> result = |
| 536 Vector<const uint8_t>(buffer.start(), length); | 536 Vector<const uint8_t>(buffer.start(), length); |
| 537 number = StringToDouble(isolate()->unicode_cache(), | 537 number = StringToDouble(isolate()->unicode_cache(), |
| 538 result, | 538 result, |
| 539 NO_FLAGS, // Hex, octal or trailing junk. | 539 NO_FLAGS, // Hex, octal or trailing junk. |
| 540 0.0); | 540 0.0); |
| 541 buffer.Dispose(); | 541 buffer.Dispose(); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 | 783 |
| 784 ASSERT_EQ('"', c0_); | 784 ASSERT_EQ('"', c0_); |
| 785 // Advance past the last '"'. | 785 // Advance past the last '"'. |
| 786 AdvanceSkipWhitespace(); | 786 AdvanceSkipWhitespace(); |
| 787 return result; | 787 return result; |
| 788 } | 788 } |
| 789 | 789 |
| 790 } } // namespace v8::internal | 790 } } // namespace v8::internal |
| 791 | 791 |
| 792 #endif // V8_JSON_PARSER_H_ | 792 #endif // V8_JSON_PARSER_H_ |
| OLD | NEW |