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

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

Issue 340783011: Take inheritance into account when computing the elements accessible by mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebased + fixes Created 6 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 | Annotate | Revision Log
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 "package:async_helper/async_helper.dart"; 8 import "package:async_helper/async_helper.dart";
9 import 'memory_source_file_helper.dart'; 9 import 'memory_source_file_helper.dart';
10 10
(...skipping 29 matching lines...) Expand all
40 40
41 Compiler compiler = new Compiler(provider.readStringFromUri, 41 Compiler compiler = new Compiler(provider.readStringFromUri,
42 outputProvider, 42 outputProvider,
43 diagnosticHandler, 43 diagnosticHandler,
44 libraryRoot, 44 libraryRoot,
45 packageRoot, 45 packageRoot,
46 [], 46 [],
47 {}); 47 {});
48 asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) { 48 asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) {
49 Expect.isFalse(compiler.compilationFailed); 49 Expect.isFalse(compiler.compilationFailed);
50 Expect.isFalse(compiler.enqueuer.resolution.hasEnqueuedEverything); 50 Expect.isFalse(compiler.enqueuer.resolution.hasEnqueuedReflectiveElements);
51 Expect.isFalse(compiler.enqueuer.resolution.hasEnqueuedReflectiveStaticField s); 51 Expect.isFalse(compiler.enqueuer.resolution.hasEnqueuedReflectiveStaticField s);
52 Expect.isFalse(compiler.enqueuer.codegen.hasEnqueuedEverything); 52 Expect.isFalse(compiler.enqueuer.codegen.hasEnqueuedReflectiveElements);
53 Expect.isFalse(compiler.enqueuer.codegen.hasEnqueuedReflectiveStaticFields); 53 Expect.isFalse(compiler.enqueuer.codegen.hasEnqueuedReflectiveStaticFields);
54 Expect.isFalse(compiler.disableTypeInference); 54 Expect.isFalse(compiler.disableTypeInference);
55 JavaScriptBackend backend = compiler.backend; 55 JavaScriptBackend backend = compiler.backend;
56 Expect.isFalse(backend.hasRetainedMetadata); 56 Expect.isFalse(backend.hasRetainedMetadata);
57 })); 57 }));
58 } 58 }
59 59
60 const Map MEMORY_SOURCE_FILES = const { 60 const Map MEMORY_SOURCE_FILES = const {
61 'main.dart': r""" 61 'main.dart': r"""
62 import 'dart:mirrors'; 62 import 'dart:mirrors';
63 63
64 class Foo { 64 class Foo {
65 noSuchMethod(invocation) { 65 noSuchMethod(invocation) {
66 print('Invoked ${MirrorSystem.getName(invocation.memberName)}'); 66 print('Invoked ${MirrorSystem.getName(invocation.memberName)}');
67 return reflect('foobar').delegate(invocation); 67 return reflect('foobar').delegate(invocation);
68 } 68 }
69 } 69 }
70 70
71 void main() { 71 void main() {
72 print(new Foo().substring(3)); 72 print(new Foo().substring(3));
73 } 73 }
74 """, 74 """,
75 }; 75 };
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/deferred_mirrors_test.dart ('k') | tests/compiler/dart2js/mirrors_used_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698