| 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 'package:compiler/implementation/apiimpl.dart' show | 9 import 'package:compiler/implementation/apiimpl.dart' show |
| 10 Compiler; | 10 Compiler; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 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 Loading... |
| 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 """}; |
| OLD | NEW |