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 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 // Check if the serialized script object matches the original script. | 834 // Check if the serialized script object matches the original script. |
835 String& expected_literal = String::Handle(); | 835 String& expected_literal = String::Handle(); |
836 String& actual_literal = String::Handle(); | 836 String& actual_literal = String::Handle(); |
837 String& str = String::Handle(); | 837 String& str = String::Handle(); |
838 str ^= serialized_script.url(); | 838 str ^= serialized_script.url(); |
839 EXPECT(url.Equals(str)); | 839 EXPECT(url.Equals(str)); |
840 | 840 |
841 const TokenStream& expected_tokens = TokenStream::Handle(script.tokens()); | 841 const TokenStream& expected_tokens = TokenStream::Handle(script.tokens()); |
842 const TokenStream& serialized_tokens = | 842 const TokenStream& serialized_tokens = |
843 TokenStream::Handle(serialized_script.tokens()); | 843 TokenStream::Handle(serialized_script.tokens()); |
844 const ExternalUint8Array& expected_data = | 844 const ExternalTypedData& expected_data = |
845 ExternalUint8Array::Handle(expected_tokens.GetStream()); | 845 ExternalTypedData::Handle(expected_tokens.GetStream()); |
846 const ExternalUint8Array& serialized_data = | 846 const ExternalTypedData& serialized_data = |
847 ExternalUint8Array::Handle(serialized_tokens.GetStream()); | 847 ExternalTypedData::Handle(serialized_tokens.GetStream()); |
848 EXPECT_EQ(expected_data.Length(), serialized_data.Length()); | 848 EXPECT_EQ(expected_data.Length(), serialized_data.Length()); |
849 TokenStream::Iterator expected_iterator(expected_tokens, 0); | 849 TokenStream::Iterator expected_iterator(expected_tokens, 0); |
850 TokenStream::Iterator serialized_iterator(serialized_tokens, 0); | 850 TokenStream::Iterator serialized_iterator(serialized_tokens, 0); |
851 Token::Kind expected_kind = expected_iterator.CurrentTokenKind(); | 851 Token::Kind expected_kind = expected_iterator.CurrentTokenKind(); |
852 Token::Kind serialized_kind = serialized_iterator.CurrentTokenKind(); | 852 Token::Kind serialized_kind = serialized_iterator.CurrentTokenKind(); |
853 while (expected_kind != Token::kEOS && serialized_kind != Token::kEOS) { | 853 while (expected_kind != Token::kEOS && serialized_kind != Token::kEOS) { |
854 EXPECT_EQ(expected_kind, serialized_kind); | 854 EXPECT_EQ(expected_kind, serialized_kind); |
855 expected_literal ^= expected_iterator.CurrentLiteral(); | 855 expected_literal ^= expected_iterator.CurrentLiteral(); |
856 actual_literal ^= serialized_iterator.CurrentLiteral(); | 856 actual_literal ^= serialized_iterator.CurrentLiteral(); |
857 EXPECT(expected_literal.Equals(actual_literal)); | 857 EXPECT(expected_literal.Equals(actual_literal)); |
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2205 EXPECT(Dart_ErrorHasException(result)); | 2205 EXPECT(Dart_ErrorHasException(result)); |
2206 EXPECT_SUBSTRING("Exception: nulltruefalse123456æøå3.14[]100123456789\n", | 2206 EXPECT_SUBSTRING("Exception: nulltruefalse123456æøå3.14[]100123456789\n", |
2207 Dart_GetError(result)); | 2207 Dart_GetError(result)); |
2208 | 2208 |
2209 Dart_ExitScope(); | 2209 Dart_ExitScope(); |
2210 } | 2210 } |
2211 | 2211 |
2212 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 2212 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
2213 | 2213 |
2214 } // namespace dart | 2214 } // namespace dart |
OLD | NEW |