OLD | NEW |
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 '../../../sdk/lib/_internal/compiler/implementation/apiimpl.dart' show | 9 import '../../../sdk/lib/_internal/compiler/implementation/apiimpl.dart' show |
10 Compiler; | 10 Compiler; |
11 import | 11 import |
12 '../../../sdk/lib/_internal/compiler/implementation/dart_backend/dart_backen
d.dart' | 12 '../../../sdk/lib/_internal/compiler/implementation/dart_backend/dart_backen
d.dart' |
13 show | 13 show |
14 DartBackend; | 14 DartBackend; |
15 import | 15 import |
16 '../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart' | 16 '../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart' |
17 show | 17 show Identifier, Node, Send; |
18 Node, Identifier; | |
19 import | 18 import |
20 '../../../sdk/lib/_internal/compiler/implementation/mirror_renamer/mirror_re
namer.dart' | 19 '../../../sdk/lib/_internal/compiler/implementation/mirror_renamer/mirror_re
namer.dart' |
21 show | 20 show |
22 MirrorRenamer; | 21 MirrorRenamer; |
23 | 22 |
24 main() { | 23 main() { |
25 testUniqueMinification(); | 24 testUniqueMinification(); |
26 testNoUniqueMinification(); | 25 testNoUniqueMinification(); |
27 } | 26 } |
28 | 27 |
(...skipping 17 matching lines...) Expand all Loading... |
46 Map<Node, String> renames = backend.renames; | 45 Map<Node, String> renames = backend.renames; |
47 Map<String, String> symbols = mirrorRenamer.symbols; | 46 Map<String, String> symbols = mirrorRenamer.symbols; |
48 | 47 |
49 // Check that no two different source code names get the same mangled name, | 48 // Check that no two different source code names get the same mangled name, |
50 // with the exception of MirrorSystem.getName that gets renamed to the same | 49 // with the exception of MirrorSystem.getName that gets renamed to the same |
51 // mangled name as the getNameHelper from _mirror_helper.dart. | 50 // mangled name as the getNameHelper from _mirror_helper.dart. |
52 for (Node node in renames.keys) { | 51 for (Node node in renames.keys) { |
53 Identifier identifier = node.asIdentifier(); | 52 Identifier identifier = node.asIdentifier(); |
54 if (identifier != null) { | 53 if (identifier != null) { |
55 String source = identifier.source; | 54 String source = identifier.source; |
56 if (mirrorRenamer.mirrorSystemGetNameNodes.first.selector == node) | 55 Send send = mirrorRenamer.mirrorSystemGetNameNodes.first; |
| 56 if (send.selector == node) |
57 continue; | 57 continue; |
58 if (symbols.containsKey(renames[node])) { | 58 if (symbols.containsKey(renames[node])) { |
59 print(node); | 59 print(node); |
60 Expect.equals(source, symbols[renames[node]]); | 60 Expect.equals(source, symbols[renames[node]]); |
61 } | 61 } |
62 } | 62 } |
63 } | 63 } |
64 })); | 64 })); |
65 } | 65 } |
66 | 66 |
(...skipping 17 matching lines...) Expand all Loading... |
84 noSuchMethod(invocation) { | 84 noSuchMethod(invocation) { |
85 MirrorSystem.getName(null); | 85 MirrorSystem.getName(null); |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 main() { | 89 main() { |
90 new Foo().fisk(); | 90 new Foo().fisk(); |
91 var hest; | 91 var hest; |
92 } | 92 } |
93 """}; | 93 """}; |
OLD | NEW |