| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // Test that parameters keep their names in the output. |
| 5 |
| 6 import 'dart:async'; |
| 7 import "package:expect/expect.dart"; |
| 8 import "package:async_helper/async_helper.dart"; |
| 9 import 'memory_compiler.dart'; |
| 10 |
| 11 const String TEST_ONE = r""" |
| 12 library main; |
| 13 |
| 14 int a = 2; |
| 15 |
| 16 class c { |
| 17 final int m; |
| 18 c(this.m); |
| 19 } |
| 20 |
| 21 void f() { |
| 22 () {} (); // TODO (sigurdm): Empty closure, hack to avoid inlining. |
| 23 a = 2; |
| 24 } |
| 25 |
| 26 main() { |
| 27 f(); |
| 28 new c(2); |
| 29 } |
| 30 """; |
| 31 |
| 32 main() { |
| 33 var compiler = compilerFor({'main.dart': TEST_ONE}); |
| 34 asyncTest(() => compiler.runCompiler(Uri.parse('memory:main.dart')).then((_) { |
| 35 var info = compiler.dumpInfoTask.collectDumpInfo(); |
| 36 var mainlib = info.libraries[0]; |
| 37 Expect.stringEquals("main", mainlib.name); |
| 38 var contents = mainlib.contents; |
| 39 Expect.stringEquals("main", mainlib.name); |
| 40 Expect.stringEquals("a", contents[0].name); |
| 41 Expect.stringEquals("c", contents[1].name); |
| 42 Expect.stringEquals("f", contents[2].name); |
| 43 Expect.stringEquals("main", contents[3].name); |
| 44 Expect.stringEquals("library", mainlib.kind); |
| 45 Expect.stringEquals("field", contents[0].kind); |
| 46 Expect.stringEquals("class", contents[1].kind); |
| 47 Expect.stringEquals("function", contents[2].kind); |
| 48 Expect.stringEquals("function", contents[3].kind); |
| 49 })); |
| 50 } |
| OLD | NEW |