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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 | 6 |
7 class A { | 7 class A { |
8 var missingSetterField; | 8 var missingSetterField; |
9 var missingGetterField; | 9 var missingGetterField; |
10 var getterInSuperClassField; | 10 var getterInSuperClassField; |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 set missingGetter(a) { missingGetterField = a; } | 24 set missingGetter(a) { missingGetterField = a; } |
25 set getterInSuperClass(a) { getterInSuperClassField = a; } | 25 set getterInSuperClass(a) { getterInSuperClassField = a; } |
26 | 26 |
27 get getterSetter => getterSetterField; | 27 get getterSetter => getterSetterField; |
28 set getterSetter(a) { getterSetterField = a; } | 28 set getterSetter(a) { getterSetterField = a; } |
29 | 29 |
30 operator[](index) => indexField[index]; | 30 operator[](index) => indexField[index]; |
31 operator[]=(index, value) { indexField[index] = value; } | 31 operator[]=(index, value) { indexField[index] = value; } |
32 | 32 |
33 noSuchMethod(InvocationMirror im) { | 33 noSuchMethod(Invocation im) { |
34 if (im.memberName.startsWith('missingSetter')) { | 34 if (im.memberName.startsWith('missingSetter')) { |
35 Expect.isTrue(im.isSetter); | 35 Expect.isTrue(im.isSetter); |
36 missingSetterField = im.positionalArguments[0]; | 36 missingSetterField = im.positionalArguments[0]; |
37 } else if (im.memberName.startsWith('missingGetter')) { | 37 } else if (im.memberName.startsWith('missingGetter')) { |
38 Expect.isTrue(im.isGetter); | 38 Expect.isTrue(im.isGetter); |
39 return missingGetterField; | 39 return missingGetterField; |
40 } else if (im.memberName.startsWith('missingAll') && im.isGetter) { | 40 } else if (im.memberName.startsWith('missingAll') && im.isGetter) { |
41 return missingAllField; | 41 return missingAllField; |
42 } else if (im.memberName.startsWith('missingAll') && im.isSetter) { | 42 } else if (im.memberName.startsWith('missingAll') && im.isSetter) { |
43 missingAllField = im.positionalArguments[0]; | 43 missingAllField = im.positionalArguments[0]; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 Expect.equals(3, super[0] += 1); | 96 Expect.equals(3, super[0] += 1); |
97 Expect.equals(3, super[0]); | 97 Expect.equals(3, super[0]); |
98 Expect.equals(3, super[0]++); | 98 Expect.equals(3, super[0]++); |
99 Expect.equals(4, super[0]); | 99 Expect.equals(4, super[0]); |
100 } | 100 } |
101 } | 101 } |
102 | 102 |
103 main() { | 103 main() { |
104 new C().test(); | 104 new C().test(); |
105 } | 105 } |
OLD | NEW |