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

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

Issue 23593002: Only emit members in mirror helper symbolsmap. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changed comment. Created 7 years, 3 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 | « tests/compiler/dart2js/mirror_helper_rename_test.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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import 'memory_compiler.dart' show compilerFor; 6 import 'memory_compiler.dart' show compilerFor;
7 import '../../../sdk/lib/_internal/compiler/implementation/apiimpl.dart' show 7 import '../../../sdk/lib/_internal/compiler/implementation/apiimpl.dart' show
8 Compiler; 8 Compiler;
9 import 9 import
10 '../../../sdk/lib/_internal/compiler/implementation/elements/elements.dart' 10 '../../../sdk/lib/_internal/compiler/implementation/elements/elements.dart'
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 Compiler compiler = runCompiler(useMirrorHelperLibrary: true, minify: minify); 51 Compiler compiler = runCompiler(useMirrorHelperLibrary: true, minify: minify);
52 52
53 DartBackend backend = compiler.backend; 53 DartBackend backend = compiler.backend;
54 MirrorRenamer mirrorRenamer = backend.mirrorRenamer; 54 MirrorRenamer mirrorRenamer = backend.mirrorRenamer;
55 Map<Node, String> renames = backend.renames; 55 Map<Node, String> renames = backend.renames;
56 Map<LibraryElement, String> imports = backend.imports; 56 Map<LibraryElement, String> imports = backend.imports;
57 57
58 Node getNameFunctionNode = 58 Node getNameFunctionNode =
59 backend.memberNodes.values.first.first.body.statements.nodes.head; 59 backend.memberNodes.values.first.first.body.statements.nodes.head;
60 60
61 Expect.equals( 61 Expect.equals(renames[mirrorRenamer.mirrorHelperGetNameFunctionNode.name],
62 const SourceString(MirrorRenamer.MIRROR_HELPER_GET_NAME_FUNCTION), 62 renames[getNameFunctionNode.expression.selector]);
63 mirrorRenamer.symbols[renames[getNameFunctionNode.expression.selector]]);
64 Expect.equals("", 63 Expect.equals("",
65 renames[getNameFunctionNode.expression.receiver]); 64 renames[getNameFunctionNode.expression.receiver]);
66 Expect.equals(1, imports.keys.length); 65 Expect.equals(1, imports.keys.length);
67 } 66 }
68 67
69 void testWithoutMirrorRenaming({bool minify}) { 68 void testWithoutMirrorRenaming({bool minify}) {
70 Compiler compiler = 69 Compiler compiler =
71 runCompiler(useMirrorHelperLibrary: false, minify: minify); 70 runCompiler(useMirrorHelperLibrary: false, minify: minify);
72 71
73 DartBackend backend = compiler.backend; 72 DartBackend backend = compiler.backend;
(...skipping 15 matching lines...) Expand all
89 class Foo { 88 class Foo {
90 noSuchMethod(Invocation invocation) { 89 noSuchMethod(Invocation invocation) {
91 MirrorSystem.getName(invocation.memberName); 90 MirrorSystem.getName(invocation.memberName);
92 } 91 }
93 } 92 }
94 93
95 void main() { 94 void main() {
96 new Foo().fisk(); 95 new Foo().fisk();
97 } 96 }
98 """}; 97 """};
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/mirror_helper_rename_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698