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

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

Issue 448943004: Refactor and simplify the dart2dart renamer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix minifying name generation Created 6 years, 4 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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import 'dart:async'; 6 import 'dart:async';
7 import "package:async_helper/async_helper.dart"; 7 import "package:async_helper/async_helper.dart";
8 import 'memory_compiler.dart' show compilerFor; 8 import 'memory_compiler.dart' show compilerFor;
9 import 'package:compiler/implementation/apiimpl.dart' show 9 import 'package:compiler/implementation/apiimpl.dart' show
10 Compiler; 10 Compiler;
(...skipping 19 matching lines...) Expand all
30 backend.useMirrorHelperLibrary = useMirrorHelperLibrary; 30 backend.useMirrorHelperLibrary = useMirrorHelperLibrary;
31 return 31 return
32 compiler.runCompiler(Uri.parse('memory:main.dart')).then((_) => compiler); 32 compiler.runCompiler(Uri.parse('memory:main.dart')).then((_) => compiler);
33 } 33 }
34 34
35 void testWithMirrorHelperLibrary({bool minify}) { 35 void testWithMirrorHelperLibrary({bool minify}) {
36 asyncTest(() => runCompiler(useMirrorHelperLibrary: true, minify: minify). 36 asyncTest(() => runCompiler(useMirrorHelperLibrary: true, minify: minify).
37 then((Compiler compiler) { 37 then((Compiler compiler) {
38 DartBackend backend = compiler.backend; 38 DartBackend backend = compiler.backend;
39 MirrorRenamer mirrorRenamer = backend.mirrorRenamer; 39 MirrorRenamer mirrorRenamer = backend.mirrorRenamer;
40 Map<Node, String> renames = backend.renames; 40 Map<Node, String> renames = backend.placeholderRenamer.renames;
41 Map<String, String> symbols = mirrorRenamer.symbols; 41 Map<String, String> symbols = mirrorRenamer.symbols;
42 42
43 Expect.isFalse(null == backend.mirrorHelperLibrary); 43 Expect.isFalse(null == backend.mirrorHelperLibrary);
44 Expect.isFalse(null == backend.mirrorHelperGetNameFunction); 44 Expect.isFalse(null == backend.mirrorHelperGetNameFunction);
45 45
46 for (Node n in renames.keys) { 46 for (Node n in renames.keys) {
47 if (symbols.containsKey(renames[n])) { 47 if (symbols.containsKey(renames[n])) {
48 if(n.toString() == 'getName') { 48 if(n.toString() == 'getName') {
49 Expect.equals( 49 Expect.equals(
50 MirrorRenamer.MIRROR_HELPER_GET_NAME_FUNCTION, 50 MirrorRenamer.MIRROR_HELPER_GET_NAME_FUNCTION,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 class Foo { 90 class Foo {
91 noSuchMethod(Invocation invocation) { 91 noSuchMethod(Invocation invocation) {
92 MirrorSystem.getName(invocation.memberName); 92 MirrorSystem.getName(invocation.memberName);
93 } 93 }
94 } 94 }
95 95
96 void main() { 96 void main() {
97 new Foo().fisk(); 97 new Foo().fisk();
98 } 98 }
99 """}; 99 """};
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/backend_dart/dart_backend_test.dart ('k') | tests/compiler/dart2js/mirror_helper_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698