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

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

Issue 17315012: Generate less code when importing dart:mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « dart/sdk/lib/_internal/lib/js_names.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
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 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 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 // Test that tree-shaking hasn't been turned off. 5 // Test that tree-shaking hasn't been turned off.
6 6
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import 'memory_source_file_helper.dart'; 8 import 'memory_source_file_helper.dart';
9 9
10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' 10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart'
(...skipping 27 matching lines...) Expand all
38 outputProvider, 38 outputProvider,
39 diagnosticHandler, 39 diagnosticHandler,
40 libraryRoot, 40 libraryRoot,
41 packageRoot, 41 packageRoot,
42 []); 42 []);
43 compiler.run(Uri.parse('memory:main.dart')); 43 compiler.run(Uri.parse('memory:main.dart'));
44 Expect.isFalse(compiler.compilationFailed); 44 Expect.isFalse(compiler.compilationFailed);
45 Expect.isFalse(compiler.enqueuer.resolution.hasEnqueuedEverything); 45 Expect.isFalse(compiler.enqueuer.resolution.hasEnqueuedEverything);
46 Expect.isFalse(compiler.enqueuer.codegen.hasEnqueuedEverything); 46 Expect.isFalse(compiler.enqueuer.codegen.hasEnqueuedEverything);
47 Expect.isFalse(compiler.disableTypeInference); 47 Expect.isFalse(compiler.disableTypeInference);
48 Expect.isFalse(compiler.backend.hasRetainedMetadata);
48 } 49 }
49 50
50 const Map MEMORY_SOURCE_FILES = const { 51 const Map MEMORY_SOURCE_FILES = const {
51 'main.dart': r""" 52 'main.dart': r"""
52 import 'dart:mirrors'; 53 import 'dart:mirrors';
53 54
54 class Foo { 55 class Foo {
55 noSuchMethod(invocation) { 56 noSuchMethod(invocation) {
56 print('Invoked ${MirrorSystem.getName(invocation.memberName)}'); 57 print('Invoked ${MirrorSystem.getName(invocation.memberName)}');
57 return reflect('foobar').delegate(invocation); 58 return reflect('foobar').delegate(invocation);
58 } 59 }
59 } 60 }
60 61
61 void main() { 62 void main() {
62 print(new Foo().substring(3)); 63 print(new Foo().substring(3));
63 } 64 }
64 """, 65 """,
65 }; 66 };
OLDNEW
« no previous file with comments | « dart/sdk/lib/_internal/lib/js_names.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698