| Index: tests/compiler/dart2js/minimal_resolution_test.dart
|
| diff --git a/tests/compiler/dart2js/minimal_resolution_test.dart b/tests/compiler/dart2js/minimal_resolution_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ca61f80488476083c1c8c75b676b355de71313a0
|
| --- /dev/null
|
| +++ b/tests/compiler/dart2js/minimal_resolution_test.dart
|
| @@ -0,0 +1,27 @@
|
| +// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +// Test that elements are not needlessly required by dart2js.
|
| +
|
| +import 'package:async_helper/async_helper.dart';
|
| +import 'package:compiler/src/compiler.dart';
|
| +import 'package:expect/expect.dart';
|
| +import 'memory_compiler.dart';
|
| +
|
| +main() {
|
| + asyncTest(() async {
|
| + await analyze('main() {}');
|
| + await analyze('main() => proxy;', proxyConstant: true);
|
| + });
|
| +}
|
| +
|
| +analyze(String code,
|
| + {bool proxyConstant: false}) async {
|
| + CompilationResult result = await runCompiler(
|
| + memorySourceFiles: {'main.dart': code},
|
| + options: ['--analyze-only']);
|
| + Expect.isTrue(result.isSuccess);
|
| + Compiler compiler = result.compiler;
|
| + Expect.equals(proxyConstant, compiler.proxyConstant != null);
|
| +}
|
|
|