Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: tests/compiler/dart2js/top_level_closure_tree_shake_test.dart

Issue 1211223002: Mark static function getters as used in codegen. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: add test Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013, 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 import 'dart:async';
6 import 'package:expect/expect.dart';
7 import 'package:async_helper/async_helper.dart';
8 import 'compiler_helper.dart';
9
10 const String TEST_ONE = r"""
11 main() {
12 var f = use;
13 if (false) {
14 // This statement and the use of 'foo' should be optimized away, causing
15 // 'foo' to be absent from the final code.
16 f(foo);
17 }
18 f(bar);
19 }
20
21 foo() => 'Tarantula!';
22 bar() => 'Coelacanth!';
23
24 use(x) {
25 print(x());
26 }
27 """;
28
29
30 main() {
31 asyncTest(() => Future.wait([
32 compileAll(TEST_ONE).then((String generated) {
33 Expect.isFalse(generated.contains('Tarantula!'),
34 "failed to remove 'foo'");
35 Expect.isTrue(generated.contains('Coelacanth!'));
36 }),
37 ]));
38 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698