OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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:async'; | 5 import 'dart:async'; |
6 import 'package:async_helper/async_helper.dart'; | 6 import 'package:async_helper/async_helper.dart'; |
7 import 'package:compiler/src/commandline_options.dart'; | 7 import 'package:compiler/src/commandline_options.dart'; |
8 import 'package:compiler/src/common.dart'; | 8 import 'package:compiler/src/common.dart'; |
9 import 'package:compiler/src/compiler.dart'; | 9 import 'package:compiler/src/compiler.dart'; |
10 import 'package:compiler/src/kernel/kernel_backend_strategy.dart'; | 10 import 'package:compiler/src/kernel/kernel_backend_strategy.dart'; |
11 import 'package:compiler/src/js_model/js_strategy.dart'; | 11 import 'package:compiler/src/js_model/js_strategy.dart'; |
12 import 'package:expect/expect.dart'; | 12 import 'package:expect/expect.dart'; |
13 import '../kernel/compiler_helper.dart'; | 13 import '../kernel/compiler_helper.dart'; |
14 import '../serialization/helper.dart'; | 14 import '../serialization/helper.dart'; |
15 | 15 |
16 const Map<String, String> SOURCE = const <String, String>{ | 16 const Map<String, String> SOURCE = const <String, String>{ |
17 'main.dart': r''' | 17 'main.dart': r''' |
18 main() {} | 18 foo({named}) => 1; |
| 19 bar(a) => !a; |
| 20 |
| 21 main() { |
| 22 foo(); |
| 23 bar(true); |
| 24 []; |
| 25 {}; |
| 26 } |
19 ''' | 27 ''' |
20 }; | 28 }; |
21 | 29 |
22 main(List<String> args) { | 30 main(List<String> args) { |
23 useJsStrategyForTesting = true; | 31 useJsStrategyForTesting = true; |
24 asyncTest(() async { | 32 asyncTest(() async { |
25 await mainInternal(args); | 33 await mainInternal(args); |
26 }); | 34 }); |
27 } | 35 } |
28 | 36 |
(...skipping 13 matching lines...) Expand all Loading... |
42 enableDebugMode(); | 50 enableDebugMode(); |
43 | 51 |
44 Compiler compiler1 = await compileWithDill(entryPoint, memorySourceFiles, [ | 52 Compiler compiler1 = await compileWithDill(entryPoint, memorySourceFiles, [ |
45 Flags.disableInlining, | 53 Flags.disableInlining, |
46 Flags.disableTypeInference | 54 Flags.disableTypeInference |
47 ], beforeRun: (Compiler compiler) { | 55 ], beforeRun: (Compiler compiler) { |
48 compiler.backendStrategy = new JsBackendStrategy(compiler); | 56 compiler.backendStrategy = new JsBackendStrategy(compiler); |
49 }, printSteps: true); | 57 }, printSteps: true); |
50 Expect.isFalse(compiler1.compilationFailed); | 58 Expect.isFalse(compiler1.compilationFailed); |
51 } | 59 } |
OLD | NEW |