| 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 // Test that we correctly intercept super getter and setter calls. | 5 // Test that we correctly intercept super getter and setter calls. |
| 6 | 6 |
| 7 import "package:expect/expect.dart"; | |
| 8 | |
| 9 var expected; | 7 var expected; |
| 10 | 8 |
| 11 class A { | 9 class A { |
| 12 set length(a) { Expect.equals(expected, a); } | 10 set length(a) { Expect.equals(expected, a); } |
| 13 get length => 41; | 11 get length => 41; |
| 14 } | 12 } |
| 15 | 13 |
| 16 class B extends A { | 14 class B extends A { |
| 17 test() { | 15 test() { |
| 18 expected = 42; | 16 expected = 42; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 29 Expect.equals(41, super.length--); | 27 Expect.equals(41, super.length--); |
| 30 Expect.equals(41, super.length); | 28 Expect.equals(41, super.length); |
| 31 } | 29 } |
| 32 } | 30 } |
| 33 | 31 |
| 34 main() { | 32 main() { |
| 35 // Ensures the list class is instantiated. | 33 // Ensures the list class is instantiated. |
| 36 print([]); | 34 print([]); |
| 37 new B().test(); | 35 new B().test(); |
| 38 } | 36 } |
| OLD | NEW |