| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // Test that parameters keep their names in the output. | 4 // Test that parameters keep their names in the output. |
| 5 | 5 |
| 6 import 'dart:convert'; | 6 import 'dart:convert'; |
| 7 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
| 8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
| 9 import 'memory_compiler.dart'; | 9 import 'memory_compiler.dart'; |
| 10 | 10 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 const String TEST_INLINED_2 = r""" | 91 const String TEST_INLINED_2 = r""" |
| 92 funcA() => funcB(); | 92 funcA() => funcB(); |
| 93 funcB() => print("hello"); | 93 funcB() => print("hello"); |
| 94 main() => funcA(); | 94 main() => funcA(); |
| 95 """; | 95 """; |
| 96 | 96 |
| 97 typedef void JsonTaking(Map<String, dynamic> json); | 97 typedef void JsonTaking(Map<String, dynamic> json); |
| 98 | 98 |
| 99 jsonTest(String program, JsonTaking testFn) async { | 99 jsonTest(String program, JsonTaking testFn) async { |
| 100 var result = await runCompiler( | 100 var result = await runCompiler( |
| 101 memorySourceFiles: {'main.dart': program}, options: ['--dump-info']); | 101 memorySourceFiles: {'main.dart': program}, |
| 102 options: ['--out=out.js', '--dump-info']); |
| 102 var compiler = result.compiler; | 103 var compiler = result.compiler; |
| 103 Expect.isFalse(compiler.compilationFailed); | 104 Expect.isFalse(compiler.compilationFailed); |
| 104 var dumpTask = compiler.dumpInfoTask; | 105 var dumpTask = compiler.dumpInfoTask; |
| 105 | 106 |
| 106 StringBuffer sb = new StringBuffer(); | 107 StringBuffer sb = new StringBuffer(); |
| 107 dumpTask.dumpInfoJson( | 108 dumpTask.dumpInfoJson( |
| 108 sb, compiler.resolutionWorldBuilder.closedWorldForTesting); | 109 sb, compiler.resolutionWorldBuilder.closedWorldForTesting); |
| 109 String json = sb.toString(); | 110 String json = sb.toString(); |
| 110 Map<String, dynamic> map = JSON.decode(json); | 111 Map<String, dynamic> map = JSON.decode(json); |
| 111 | 112 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 Expect.isTrue(main_ != null); | 174 Expect.isTrue(main_ != null); |
| 174 Expect.isTrue(fn1 != null); | 175 Expect.isTrue(fn1 != null); |
| 175 Expect.isTrue(fn2 != null); | 176 Expect.isTrue(fn2 != null); |
| 176 Expect.isTrue(deps.containsKey(main_['id'])); | 177 Expect.isTrue(deps.containsKey(main_['id'])); |
| 177 Expect.isTrue(deps.containsKey(fn1['id'])); | 178 Expect.isTrue(deps.containsKey(fn1['id'])); |
| 178 Expect.isTrue(deps.containsKey(fn2['id'])); | 179 Expect.isTrue(deps.containsKey(fn2['id'])); |
| 179 Expect.isTrue(deps[main_['id']].any((dep) => dep['id'] == fn1['id'])); | 180 Expect.isTrue(deps[main_['id']].any((dep) => dep['id'] == fn1['id'])); |
| 180 Expect.isTrue(deps[fn1['id']].any((dep) => dep['id'] == fn2['id'])); | 181 Expect.isTrue(deps[fn1['id']].any((dep) => dep['id'] == fn2['id'])); |
| 181 }); | 182 }); |
| 182 } | 183 } |
| OLD | NEW |