| 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 // Make sure that limiting mirrors through @MirrorsUsed does not | 5 // Make sure that limiting mirrors through @MirrorsUsed does not |
| 6 // affect optimizations done on arrays. | 6 // affect optimizations done on arrays. |
| 7 | 7 |
| 8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
| 9 import "package:async_helper/async_helper.dart"; | 9 import "package:async_helper/async_helper.dart"; |
| 10 import 'memory_compiler.dart'; | 10 import 'memory_compiler.dart'; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 field.invoke(#clear, []); | 27 field.invoke(#clear, []); |
| 28 return array.length; | 28 return array.length; |
| 29 } | 29 } |
| 30 ''', | 30 ''', |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 main() { | 33 main() { |
| 34 asyncTest(() async { | 34 asyncTest(() async { |
| 35 var result = await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES); | 35 var result = await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES); |
| 36 var compiler = result.compiler; | 36 var compiler = result.compiler; |
| 37 var element = compiler.mainFunction; | 37 var element = compiler.frontendStrategy.elementEnvironment.mainFunction; |
| 38 var code = compiler.backend.getGeneratedCode(element); | 38 var code = compiler.backend.getGeneratedCode(element); |
| 39 Expect.isTrue(code.contains('return 2'), "Unexpected code:\n$code"); | 39 Expect.isTrue(code.contains('return 2'), "Unexpected code:\n$code"); |
| 40 }); | 40 }); |
| 41 } | 41 } |
| OLD | NEW |