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. | 5 // Additional Dart code may be 'placed on' hidden native classes. |
6 | 6 |
| 7 import "package:expect/expect.dart"; |
7 import 'native_metadata.dart'; | 8 import 'native_metadata.dart'; |
8 | 9 |
9 @Native("*A") | 10 @Native("*A") |
10 class A { | 11 class A { |
11 | 12 |
12 var _field; | 13 var _field; |
13 | 14 |
14 int get X => _field; | 15 int get X => _field; |
15 void set X(int x) { _field = x; } | 16 void set X(int x) { _field = x; } |
16 | 17 |
(...skipping 11 matching lines...) Expand all Loading... |
28 | 29 |
29 main() { | 30 main() { |
30 setup(); | 31 setup(); |
31 | 32 |
32 var a = makeA(); | 33 var a = makeA(); |
33 | 34 |
34 a.X = 100; | 35 a.X = 100; |
35 Expect.equals(100, a.X); | 36 Expect.equals(100, a.X); |
36 Expect.equals(150, a.method(50)); | 37 Expect.equals(150, a.method(50)); |
37 } | 38 } |
OLD | NEW |