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 library test.invoke_test; | 5 library test.invoke_test; |
6 | 6 |
7 import 'dart:mirrors'; | 7 import 'dart:mirrors'; |
8 | 8 |
9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
10 import '../../async_helper.dart'; | 10 import "package:async_helper/async_helper.dart"; |
11 | 11 |
12 class C { | 12 class C { |
13 var field; | 13 var field; |
14 C() : this.field = 'default'; | 14 C() : this.field = 'default'; |
15 C.named(this.field); | 15 C.named(this.field); |
16 | 16 |
17 get getter => 'get $field'; | 17 get getter => 'get $field'; |
18 set setter(v) => field = 'set $v'; | 18 set setter(v) => field = 'set $v'; |
19 method(x, y, z) => '$x+$y+$z'; | 19 method(x, y, z) => '$x+$y+$z'; |
20 toString() => 'a C'; | 20 toString() => 'a C'; |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 Expect.equals(c, libraryField); | 346 Expect.equals(c, libraryField); |
347 }); | 347 }); |
348 future = lm.setFieldAsync(const Symbol('doesntExist'), 'lbar'); | 348 future = lm.setFieldAsync(const Symbol('doesntExist'), 'lbar'); |
349 expectError(future, isNoSuchMethodError, 'Not defined'); | 349 expectError(future, isNoSuchMethodError, 'Not defined'); |
350 } | 350 } |
351 | 351 |
352 main() { | 352 main() { |
353 testSync(); | 353 testSync(); |
354 testAsync(); | 354 testAsync(); |
355 } | 355 } |
OLD | NEW |