| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 // Test that we correctly intercept super getter and setter calls. |
| 6 |
| 7 var expected; |
| 8 |
| 9 class A { |
| 10 set length(a) { Expect.equals(expected, a); } |
| 11 get length => 41; |
| 12 } |
| 13 |
| 14 class B extends A { |
| 15 test() { |
| 16 expected = 42; |
| 17 Expect.equals(42, super.length = 42); |
| 18 expected = 42; |
| 19 Expect.equals(42, super.length += 1); |
| 20 expected = 42; |
| 21 Expect.equals(42, ++super.length); |
| 22 expected = 40; |
| 23 Expect.equals(40, --super.length); |
| 24 expected = 42; |
| 25 Expect.equals(41, super.length++); |
| 26 expected = 40; |
| 27 Expect.equals(41, super.length--); |
| 28 Expect.equals(41, super.length); |
| 29 } |
| 30 } |
| 31 |
| 32 main() { |
| 33 // Ensures the list class is instantiated. |
| 34 print([]); |
| 35 new B().test(); |
| 36 } |
| OLD | NEW |