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 'dart:io'; | 5 import 'dart:io'; |
6 import 'package:expect/expect.dart'; | 6 import 'package:expect/expect.dart'; |
7 import 'package:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
8 import 'package:compiler/src/dart2jslib.dart'; | 8 import 'package:compiler/src/dart2jslib.dart'; |
9 import 'package:compiler/src/elements/elements.dart'; | 9 import 'package:compiler/src/elements/elements.dart'; |
10 import 'package:compiler/src/js_backend/js_backend.dart'; | 10 import 'package:compiler/src/js_backend/js_backend.dart'; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 print(methodNoInline('bar')); | 42 print(methodNoInline('bar')); |
43 print(methodNoInlineTrustTypeAnnotations(42)); | 43 print(methodNoInlineTrustTypeAnnotations(42)); |
44 print(methodNoInlineTrustTypeAnnotations("fourtyTwo")); | 44 print(methodNoInlineTrustTypeAnnotations("fourtyTwo")); |
45 print(methodAssumeDynamicTrustTypeAnnotations(null)); | 45 print(methodAssumeDynamicTrustTypeAnnotations(null)); |
46 } | 46 } |
47 """ | 47 """ |
48 }; | 48 }; |
49 | 49 |
50 main() { | 50 main() { |
51 Compiler compiler = compilerFor(MEMORY_SOURCE_FILES); | 51 Compiler compiler = compilerFor(MEMORY_SOURCE_FILES); |
52 asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) { | 52 asyncTest(() => compiler.runCompiler(Uri.parse('memory:main.dart')).then((_) { |
53 Expect.isFalse(compiler.compilationFailed, 'Unsuccessful compilation'); | 53 Expect.isFalse(compiler.compilationFailed, 'Unsuccessful compilation'); |
54 JavaScriptBackend backend = compiler.backend; | 54 JavaScriptBackend backend = compiler.backend; |
55 Expect.isNotNull(backend.annotations.expectNoInlineClass, | 55 Expect.isNotNull(backend.annotations.expectNoInlineClass, |
56 'NoInlineClass is unresolved.'); | 56 'NoInlineClass is unresolved.'); |
57 Expect.isNotNull(backend.annotations.expectTrustTypeAnnotationsClass, | 57 Expect.isNotNull(backend.annotations.expectTrustTypeAnnotationsClass, |
58 'TrustTypeAnnotations is unresolved.'); | 58 'TrustTypeAnnotations is unresolved.'); |
59 Expect.isNotNull(backend.annotations.expectAssumeDynamicClass, | 59 Expect.isNotNull(backend.annotations.expectAssumeDynamicClass, |
60 'AssumeDynamicClass is unresolved.'); | 60 'AssumeDynamicClass is unresolved.'); |
61 | 61 |
62 void testTypeMatch(FunctionElement function, TypeMask expectedParameterType, | 62 void testTypeMatch(FunctionElement function, TypeMask expectedParameterType, |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 expectTrustTypeAnnotations: true, | 118 expectTrustTypeAnnotations: true, |
119 expectedParameterType: jsStringType, | 119 expectedParameterType: jsStringType, |
120 expectedReturnType: jsIntType); | 120 expectedReturnType: jsIntType); |
121 test('methodAssumeDynamicTrustTypeAnnotations', | 121 test('methodAssumeDynamicTrustTypeAnnotations', |
122 expectAssumeDynamic: true, | 122 expectAssumeDynamic: true, |
123 expectTrustTypeAnnotations: true, | 123 expectTrustTypeAnnotations: true, |
124 expectedParameterType: coreStringType); | 124 expectedParameterType: coreStringType); |
125 | 125 |
126 })); | 126 })); |
127 } | 127 } |
OLD | NEW |