OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016, 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 |
| 5 import 'expect.dart'; |
| 6 |
| 7 var field; |
| 8 |
| 9 get getField { |
| 10 print('B.getField'); |
| 11 return field; |
| 12 } |
| 13 |
| 14 set setField(value) { |
| 15 print('B.setField'); |
| 16 field = value; |
| 17 return null; |
| 18 } |
| 19 |
| 20 main() { |
| 21 var result; |
| 22 |
| 23 result = (field = 42); |
| 24 Expect.isTrue(result == 42); |
| 25 Expect.isTrue(field == 42); |
| 26 Expect.isTrue(getField == 42); |
| 27 |
| 28 result = (setField = 99); |
| 29 Expect.isTrue(result == 99); |
| 30 Expect.isTrue(field == 99); |
| 31 Expect.isTrue(getField == 99); |
| 32 } |
OLD | NEW |