| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "include/dart_debugger_api.h" | 5 #include "include/dart_debugger_api.h" |
| 6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_api_message.h" | 10 #include "vm/dart_api_message.h" |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 serialized_kind = serialized_iterator.CurrentTokenKind(); | 776 serialized_kind = serialized_iterator.CurrentTokenKind(); |
| 777 } | 777 } |
| 778 | 778 |
| 779 // Check if we are able to generate the source from the token stream. | 779 // Check if we are able to generate the source from the token stream. |
| 780 // Rescan this source and compare the token stream to see if they are | 780 // Rescan this source and compare the token stream to see if they are |
| 781 // the same. | 781 // the same. |
| 782 str ^= serialized_tokens.GenerateSource(); | 782 str ^= serialized_tokens.GenerateSource(); |
| 783 const String& dummy_key = String::Handle(String::New("")); | 783 const String& dummy_key = String::Handle(String::New("")); |
| 784 Scanner scanner(str, dummy_key); | 784 Scanner scanner(str, dummy_key); |
| 785 const TokenStream& reconstructed_tokens = | 785 const TokenStream& reconstructed_tokens = |
| 786 TokenStream::Handle(TokenStream::New(scanner.GetStream())); | 786 TokenStream::Handle(TokenStream::New(scanner.GetStream(), dummy_key)); |
| 787 expected_iterator.SetCurrentPosition(0); | 787 expected_iterator.SetCurrentPosition(0); |
| 788 TokenStream::Iterator reconstructed_iterator(reconstructed_tokens, 0); | 788 TokenStream::Iterator reconstructed_iterator(reconstructed_tokens, 0); |
| 789 expected_kind = expected_iterator.CurrentTokenKind(); | 789 expected_kind = expected_iterator.CurrentTokenKind(); |
| 790 Token::Kind reconstructed_kind = reconstructed_iterator.CurrentTokenKind(); | 790 Token::Kind reconstructed_kind = reconstructed_iterator.CurrentTokenKind(); |
| 791 while (expected_kind != Token::kEOS && reconstructed_kind != Token::kEOS) { | 791 while (expected_kind != Token::kEOS && reconstructed_kind != Token::kEOS) { |
| 792 EXPECT_EQ(expected_kind, reconstructed_kind); | 792 EXPECT_EQ(expected_kind, reconstructed_kind); |
| 793 expected_literal ^= expected_iterator.CurrentLiteral(); | 793 expected_literal ^= expected_iterator.CurrentLiteral(); |
| 794 actual_literal ^= reconstructed_iterator.CurrentLiteral(); | 794 actual_literal ^= reconstructed_iterator.CurrentLiteral(); |
| 795 EXPECT(expected_literal.Equals(actual_literal)); | 795 EXPECT(expected_literal.Equals(actual_literal)); |
| 796 expected_iterator.Advance(); | 796 expected_iterator.Advance(); |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1562 EXPECT(Dart_ErrorHasException(result)); | 1562 EXPECT(Dart_ErrorHasException(result)); |
| 1563 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", | 1563 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", |
| 1564 Dart_GetError(result)); | 1564 Dart_GetError(result)); |
| 1565 | 1565 |
| 1566 Dart_ExitScope(); | 1566 Dart_ExitScope(); |
| 1567 } | 1567 } |
| 1568 | 1568 |
| 1569 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 1569 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 1570 | 1570 |
| 1571 } // namespace dart | 1571 } // namespace dart |
| OLD | NEW |