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 |
11 const String TEST_BASIC = r""" | 11 const String TEST_BASIC = r""" |
12 library main; | 12 library main; |
13 | 13 |
14 int a = 2; | 14 int a = 2; |
15 | 15 |
16 class c { | 16 class c { |
17 final int m; | 17 final int m; |
18 c(this.m) { | 18 c(this.m) { |
19 () {} (); // TODO (sigurdm): Empty closure, hack to avoid inlining. | 19 () {} (); // TODO (sigurdm): Empty closure, hack to avoid inlining. |
20 a = 1; | 20 a = 1; |
21 } | 21 } |
22 foo() { | 22 foo() { |
23 () {} (); | 23 () {} (); |
24 k = 2; | 24 k = 2; |
25 print(k); | 25 print(k); |
26 print(p); | 26 print(p); |
27 } | 27 } |
28 var k = (() => 10)(); | 28 var k = (() => 10)(); |
29 final static p = 20; | 29 static final p = 20; |
30 } | 30 } |
31 | 31 |
32 void f() { | 32 void f() { |
33 () {} (); | 33 () {} (); |
34 a = 3; | 34 a = 3; |
35 } | 35 } |
36 | 36 |
37 main() { | 37 main() { |
38 print(a); | 38 print(a); |
39 f(); | 39 f(); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 Expect.isTrue(main_ != null); | 174 Expect.isTrue(main_ != null); |
175 Expect.isTrue(fn1 != null); | 175 Expect.isTrue(fn1 != null); |
176 Expect.isTrue(fn2 != null); | 176 Expect.isTrue(fn2 != null); |
177 Expect.isTrue(deps.containsKey(main_['id'])); | 177 Expect.isTrue(deps.containsKey(main_['id'])); |
178 Expect.isTrue(deps.containsKey(fn1['id'])); | 178 Expect.isTrue(deps.containsKey(fn1['id'])); |
179 Expect.isTrue(deps.containsKey(fn2['id'])); | 179 Expect.isTrue(deps.containsKey(fn2['id'])); |
180 Expect.isTrue(deps[main_['id']].any((dep) => dep['id'] == fn1['id'])); | 180 Expect.isTrue(deps[main_['id']].any((dep) => dep['id'] == fn1['id'])); |
181 Expect.isTrue(deps[fn1['id']].any((dep) => dep['id'] == fn2['id'])); | 181 Expect.isTrue(deps[fn1['id']].any((dep) => dep['id'] == fn2['id'])); |
182 }); | 182 }); |
183 } | 183 } |
OLD | NEW |