OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // Additional Dart code may be 'placed on' hidden native classes. With | 5 // Additional Dart code may be 'placed on' hidden native classes. With |
6 // inheritance, the superclass method must not be reached by a call on the | 6 // inheritance, the superclass method must not be reached by a call on the |
7 // subclass. | 7 // subclass. |
8 | 8 |
9 @native("*A") | 9 @native("*A") |
10 class A { | 10 class A { |
11 var _field; | 11 var _field; |
12 | 12 |
13 int get X => _field; | 13 int get X => _field; |
14 void set X(int x) { _field = x; } | 14 void set X(int x) { _field = x; } |
15 | 15 |
16 int method(int z) => _field + z; | 16 int method(int z) => _field + z; |
17 } | 17 } |
18 | 18 |
19 @native("*B") | 19 @native("*B") |
20 class B extends A { | 20 class B extends A { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 } | 139 } |
140 | 140 |
141 main() { | 141 main() { |
142 testBasicA_dynamic(); | 142 testBasicA_dynamic(); |
143 testBasicA_typed(); | 143 testBasicA_typed(); |
144 testBasicB_dynamic(); | 144 testBasicB_dynamic(); |
145 testBasicB_typed(); | 145 testBasicB_typed(); |
146 testAB_dynamic(); | 146 testAB_dynamic(); |
147 testAB_typed(); | 147 testAB_typed(); |
148 } | 148 } |
OLD | NEW |