| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 // Test that elements are not needlessly required by dart2js. |
| 6 |
| 7 import 'package:async_helper/async_helper.dart'; |
| 8 import 'package:compiler/src/compiler.dart'; |
| 9 import 'package:expect/expect.dart'; |
| 10 import 'memory_compiler.dart'; |
| 11 |
| 12 main() { |
| 13 asyncTest(() async { |
| 14 await analyze('main() {}'); |
| 15 await analyze('main() => proxy;', proxyConstant: true); |
| 16 }); |
| 17 } |
| 18 |
| 19 analyze(String code, |
| 20 {bool proxyConstant: false}) async { |
| 21 CompilationResult result = await runCompiler( |
| 22 memorySourceFiles: {'main.dart': code}, |
| 23 options: ['--analyze-only']); |
| 24 Expect.isTrue(result.isSuccess); |
| 25 Compiler compiler = result.compiler; |
| 26 Expect.equals(proxyConstant, compiler.proxyConstant != null); |
| 27 } |
| OLD | NEW |