| 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 '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 Loading... |
| 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 Loading... |
| 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 """}; |
| OLD | NEW |