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 "package:async_helper/async_helper.dart"; | 6 import "package:async_helper/async_helper.dart"; |
7 | 7 |
8 import 'compiler_helper.dart'; | 8 import 'compiler_helper.dart'; |
9 import 'parser_helper.dart'; | |
10 | 9 |
11 const String TEST = r''' | 10 const String TEST = r''' |
12 class A { | 11 class A { |
13 var field = 42; | 12 var field = 42; |
14 } | 13 } |
15 main() { | 14 main() { |
16 var a = new A(); | 15 var a = new A(); |
17 var b = [42, -1]; | 16 var b = [42, -1]; |
18 // Force a setter on [field]. | 17 // Force a setter on [field]. |
19 if (false) a.field = 12; | 18 if (false) a.field = 12; |
20 var c = a.field; | 19 var c = a.field; |
21 print(b[0] ~/ b[1]); | 20 print(b[0] ~/ b[1]); |
22 return c + a.field; | 21 return c + a.field; |
23 } | 22 } |
24 '''; | 23 '''; |
25 | 24 |
26 void main() { | 25 void main() { |
27 asyncTest(() => compileAll(TEST).then((generated) { | 26 asyncTest(() => compileAll(TEST).then((generated) { |
28 Expect.isTrue(generated.contains('return c + c;')); | 27 Expect.isTrue(generated.contains('return c + c;')); |
29 })); | 28 })); |
30 } | 29 } |
OLD | NEW |