OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 i::HandleScope test_scope(isolate); | 648 i::HandleScope test_scope(isolate); |
649 i::SmartArrayPointer<i::uc16> uc16_buffer(new i::uc16[length]); | 649 i::SmartArrayPointer<i::uc16> uc16_buffer(new i::uc16[length]); |
650 for (unsigned i = 0; i < length; i++) { | 650 for (unsigned i = 0; i < length; i++) { |
651 uc16_buffer[i] = static_cast<i::uc16>(ascii_source[i]); | 651 uc16_buffer[i] = static_cast<i::uc16>(ascii_source[i]); |
652 } | 652 } |
653 i::Vector<const char> ascii_vector(ascii_source, static_cast<int>(length)); | 653 i::Vector<const char> ascii_vector(ascii_source, static_cast<int>(length)); |
654 i::Handle<i::String> ascii_string( | 654 i::Handle<i::String> ascii_string( |
655 factory->NewStringFromAscii(ascii_vector)); | 655 factory->NewStringFromAscii(ascii_vector)); |
656 TestExternalResource resource(uc16_buffer.get(), length); | 656 TestExternalResource resource(uc16_buffer.get(), length); |
657 i::Handle<i::String> uc16_string( | 657 i::Handle<i::String> uc16_string( |
658 factory->NewExternalStringFromTwoByte(&resource)); | 658 factory->NewExternalStringFromTwoByte(&resource).ToHandleChecked()); |
659 | 659 |
660 i::ExternalTwoByteStringUtf16CharacterStream uc16_stream( | 660 i::ExternalTwoByteStringUtf16CharacterStream uc16_stream( |
661 i::Handle<i::ExternalTwoByteString>::cast(uc16_string), start, end); | 661 i::Handle<i::ExternalTwoByteString>::cast(uc16_string), start, end); |
662 i::GenericStringUtf16CharacterStream string_stream(ascii_string, start, end); | 662 i::GenericStringUtf16CharacterStream string_stream(ascii_string, start, end); |
663 i::Utf8ToUtf16CharacterStream utf8_stream( | 663 i::Utf8ToUtf16CharacterStream utf8_stream( |
664 reinterpret_cast<const i::byte*>(ascii_source), end); | 664 reinterpret_cast<const i::byte*>(ascii_source), end); |
665 utf8_stream.SeekForward(start); | 665 utf8_stream.SeekForward(start); |
666 | 666 |
667 unsigned i = start; | 667 unsigned i = start; |
668 while (i < end) { | 668 while (i < end) { |
(...skipping 1928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2597 RunParserSyncTest(assignment_context_data, bad_statement_data_common, kError); | 2597 RunParserSyncTest(assignment_context_data, bad_statement_data_common, kError); |
2598 RunParserSyncTest(assignment_context_data, bad_statement_data_for_assignment, | 2598 RunParserSyncTest(assignment_context_data, bad_statement_data_for_assignment, |
2599 kError); | 2599 kError); |
2600 | 2600 |
2601 RunParserSyncTest(prefix_context_data, good_statement_data, kSuccess); | 2601 RunParserSyncTest(prefix_context_data, good_statement_data, kSuccess); |
2602 RunParserSyncTest(prefix_context_data, bad_statement_data_common, kError); | 2602 RunParserSyncTest(prefix_context_data, bad_statement_data_common, kError); |
2603 | 2603 |
2604 RunParserSyncTest(postfix_context_data, good_statement_data, kSuccess); | 2604 RunParserSyncTest(postfix_context_data, good_statement_data, kSuccess); |
2605 RunParserSyncTest(postfix_context_data, bad_statement_data_common, kError); | 2605 RunParserSyncTest(postfix_context_data, bad_statement_data_common, kError); |
2606 } | 2606 } |
OLD | NEW |