OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library dart2js.serialization_test; | 5 library dart2js.serialization_test; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 import '../memory_compiler.dart'; | 8 import '../memory_compiler.dart'; |
9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
10 import 'package:compiler/src/commandline_options.dart'; | 10 import 'package:compiler/src/commandline_options.dart'; |
11 import 'package:compiler/src/common.dart'; | 11 import 'package:compiler/src/common.dart'; |
12 import 'package:compiler/src/common/resolution.dart'; | 12 import 'package:compiler/src/common/resolution.dart'; |
13 import 'package:compiler/src/constants/constructors.dart'; | 13 import 'package:compiler/src/constants/constructors.dart'; |
14 import 'package:compiler/src/compiler.dart'; | 14 import 'package:compiler/src/compiler.dart'; |
15 import 'package:compiler/src/diagnostics/invariant.dart'; | 15 import 'package:compiler/src/diagnostics/invariant.dart'; |
16 import 'package:compiler/src/elements/elements.dart'; | 16 import 'package:compiler/src/elements/elements.dart'; |
17 import 'package:compiler/src/elements/visitor.dart'; | 17 import 'package:compiler/src/elements/visitor.dart'; |
18 import 'package:compiler/src/filenames.dart'; | 18 import 'package:compiler/src/filenames.dart'; |
19 import 'package:compiler/src/library_loader.dart'; | 19 import 'package:compiler/src/library_loader.dart'; |
20 import 'package:compiler/src/ordered_typeset.dart'; | 20 import 'package:compiler/src/ordered_typeset.dart'; |
21 import 'package:compiler/src/serialization/element_serialization.dart'; | 21 import 'package:compiler/src/serialization/element_serialization.dart'; |
22 import 'package:compiler/src/serialization/equivalence.dart'; | 22 import 'package:compiler/src/serialization/equivalence.dart'; |
23 import 'package:compiler/src/serialization/json_serializer.dart'; | 23 import 'package:compiler/src/serialization/json_serializer.dart'; |
24 import 'package:compiler/src/serialization/serialization.dart'; | 24 import 'package:compiler/src/serialization/serialization.dart'; |
25 import 'package:expect/expect.dart'; | 25 import 'package:expect/expect.dart'; |
26 import 'test_helper.dart'; | 26 import 'test_helper.dart'; |
27 | 27 |
28 const TEST_SOURCES = const <String, String>{ | 28 const TEST_SOURCES = const <String, String>{ |
29 'main.dart': ''' | 29 'main.dart': ''' |
| 30 import 'library.dart'; |
30 import 'deferred_library.dart' deferred as prefix; | 31 import 'deferred_library.dart' deferred as prefix; |
31 | 32 |
32 asyncMethod() async {} | 33 asyncMethod() async {} |
33 asyncStarMethod() async* {} | 34 asyncStarMethod() async* {} |
34 syncStarMethod() sync* {} | 35 syncStarMethod() sync* {} |
35 get asyncGetter async {} | 36 get asyncGetter async {} |
36 get asyncStarGetter async* {} | 37 get asyncStarGetter async* {} |
37 get syncStarGetter sync* {} | 38 get syncStarGetter sync* {} |
38 | 39 |
39 genericMethod<T>() {} | 40 genericMethod<T>() {} |
40 | 41 |
41 class Class1 { | 42 class Class1 { |
42 factory Class1.deferred() = prefix.DeferredClass; | 43 factory Class1.deferred() = prefix.DeferredClass; |
43 factory Class1.unresolved() = Unresolved; | 44 factory Class1.unresolved() = Unresolved; |
44 } | 45 } |
45 ''', | 46 ''', |
46 'deferred_library.dart': ''' | 47 'deferred_library.dart': ''' |
47 class DeferredClass { | 48 class DeferredClass { |
48 } | 49 } |
49 ''', | 50 ''', |
| 51 'library.dart': ''' |
| 52 class Type {} |
| 53 ''', |
50 }; | 54 }; |
51 | 55 |
52 main(List<String> arguments) { | 56 main(List<String> arguments) { |
53 // Ensure that we can print out constant expressions. | 57 // Ensure that we can print out constant expressions. |
54 DEBUG_MODE = true; | 58 DEBUG_MODE = true; |
55 | 59 |
56 Uri entryPoint; | 60 Uri entryPoint; |
57 String outPath; | 61 String outPath; |
58 bool prettyPrint = false; | 62 bool prettyPrint = false; |
59 for (String arg in arguments) { | 63 for (String arg in arguments) { |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 'loadLibrary', element1.loadLibrary, element2.loadLibrary); | 851 'loadLibrary', element1.loadLibrary, element2.loadLibrary); |
848 } | 852 } |
849 // TODO(johnniwinther): Check members. | 853 // TODO(johnniwinther): Check members. |
850 } | 854 } |
851 | 855 |
852 @override | 856 @override |
853 void visitErroneousElement(ErroneousElement element1, ErroneousElement element
2) { | 857 void visitErroneousElement(ErroneousElement element1, ErroneousElement element
2) { |
854 check(element1, element2, 'messageKind', element1.messageKind, element2.mess
ageKind); | 858 check(element1, element2, 'messageKind', element1.messageKind, element2.mess
ageKind); |
855 } | 859 } |
856 } | 860 } |
OLD | NEW |