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 import 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
6 import 'package:async_helper/async_helper.dart'; | 6 import 'package:async_helper/async_helper.dart'; |
7 import 'package:compiler/src/compiler.dart'; | 7 import 'package:compiler/src/compiler.dart'; |
8 import 'package:compiler/src/elements/elements.dart'; | 8 import 'package:compiler/src/elements/elements.dart'; |
9 import 'package:compiler/src/js_backend/js_backend.dart'; | 9 import 'package:compiler/src/js_backend/js_backend.dart'; |
10 import 'package:compiler/src/types/types.dart'; | 10 import 'package:compiler/src/types/types.dart'; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 print(methodAssumeDynamicTrustTypeAnnotations(null)); | 45 print(methodAssumeDynamicTrustTypeAnnotations(null)); |
46 } | 46 } |
47 """ | 47 """ |
48 }; | 48 }; |
49 | 49 |
50 main() { | 50 main() { |
51 asyncTest(() async { | 51 asyncTest(() async { |
52 CompilationResult result = | 52 CompilationResult result = |
53 await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES); | 53 await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES); |
54 Compiler compiler = result.compiler; | 54 Compiler compiler = result.compiler; |
55 ClosedWorld closedWorld = compiler.resolverWorld.closedWorldForTesting; | 55 ClosedWorld closedWorld = |
| 56 compiler.resolutionWorldBuilder.closedWorldForTesting; |
56 Expect.isFalse(compiler.compilationFailed, 'Unsuccessful compilation'); | 57 Expect.isFalse(compiler.compilationFailed, 'Unsuccessful compilation'); |
57 JavaScriptBackend backend = compiler.backend; | 58 JavaScriptBackend backend = compiler.backend; |
58 Expect.isNotNull(backend.annotations.expectNoInlineClass, | 59 Expect.isNotNull(backend.annotations.expectNoInlineClass, |
59 'NoInlineClass is unresolved.'); | 60 'NoInlineClass is unresolved.'); |
60 Expect.isNotNull(backend.annotations.expectTrustTypeAnnotationsClass, | 61 Expect.isNotNull(backend.annotations.expectTrustTypeAnnotationsClass, |
61 'TrustTypeAnnotations is unresolved.'); | 62 'TrustTypeAnnotations is unresolved.'); |
62 Expect.isNotNull(backend.annotations.expectAssumeDynamicClass, | 63 Expect.isNotNull(backend.annotations.expectAssumeDynamicClass, |
63 'AssumeDynamicClass is unresolved.'); | 64 'AssumeDynamicClass is unresolved.'); |
64 | 65 |
65 void testTypeMatch(FunctionElement function, TypeMask expectedParameterType, | 66 void testTypeMatch(FunctionElement function, TypeMask expectedParameterType, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 expectNoInline: true, | 119 expectNoInline: true, |
119 expectTrustTypeAnnotations: true, | 120 expectTrustTypeAnnotations: true, |
120 expectedParameterType: jsStringType, | 121 expectedParameterType: jsStringType, |
121 expectedReturnType: jsIntType); | 122 expectedReturnType: jsIntType); |
122 test('methodAssumeDynamicTrustTypeAnnotations', | 123 test('methodAssumeDynamicTrustTypeAnnotations', |
123 expectAssumeDynamic: true, | 124 expectAssumeDynamic: true, |
124 expectTrustTypeAnnotations: true, | 125 expectTrustTypeAnnotations: true, |
125 expectedParameterType: coreStringType); | 126 expectedParameterType: coreStringType); |
126 }); | 127 }); |
127 } | 128 } |
OLD | NEW |