| 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.synthetic_accessor_properties; | 5 library test.synthetic_accessor_properties; |
| 6 | 6 |
| 7 import 'dart:mirrors'; | 7 import 'dart:mirrors'; |
| 8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
| 9 | 9 |
| 10 import 'stringify.dart'; | 10 import 'stringify.dart'; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 ' type = Class(s(bool) in s(dart.core), top-level))', pm); | 61 ' type = Class(s(bool) in s(dart.core), top-level))', pm); |
| 62 | 62 |
| 63 mm = cm.staticMembers[#finalStaticField]; | 63 mm = cm.staticMembers[#finalStaticField]; |
| 64 expect('Method(s(finalStaticField) in s(C), synthetic, static, getter)', mm); | 64 expect('Method(s(finalStaticField) in s(C), synthetic, static, getter)', mm); |
| 65 Expect.equals(reflectClass(int), mm.returnType); | 65 Expect.equals(reflectClass(int), mm.returnType); |
| 66 Expect.listEquals([], mm.parameters); | 66 Expect.listEquals([], mm.parameters); |
| 67 | 67 |
| 68 mm = cm.staticMembers[const Symbol('finalStaticField=')]; | 68 mm = cm.staticMembers[const Symbol('finalStaticField=')]; |
| 69 Expect.isNull(mm); | 69 Expect.isNull(mm); |
| 70 | 70 |
| 71 return; /// 01: ok | |
| 72 | 71 |
| 73 mm = lm.topLevelMembers[#topLevelField]; | 72 mm = lm.topLevelMembers[#topLevelField]; |
| 74 expect('Method(s(topLevelField) in s(test.synthetic_accessor_properties),' | 73 expect('Method(s(topLevelField) in s(test.synthetic_accessor_properties),' |
| 75 ' top-level, synthetic, static, getter)', mm); | 74 ' top-level, synthetic, static, getter)', mm); |
| 76 Expect.equals(reflectClass(String), mm.returnType); | 75 Expect.equals(reflectClass(String), mm.returnType); |
| 77 Expect.listEquals([], mm.parameters); | 76 Expect.listEquals([], mm.parameters); |
| 78 | 77 |
| 79 mm = lm.topLevelMembers[const Symbol('topLevelField=')]; | 78 mm = lm.topLevelMembers[const Symbol('topLevelField=')]; |
| 80 expect('Method(s(topLevelField=) in s(test.synthetic_accessor_properties),' | 79 expect('Method(s(topLevelField=) in s(test.synthetic_accessor_properties),' |
| 81 ' top-level, synthetic, static, setter)', mm); | 80 ' top-level, synthetic, static, setter)', mm); |
| 82 Expect.equals(reflectClass(String), mm.returnType); | 81 Expect.equals(reflectClass(String), mm.returnType); |
| 83 pm = mm.parameters.single; | 82 pm = mm.parameters.single; |
| 84 expect('Parameter(s(topLevelField) in s(topLevelField=), final,' | 83 expect('Parameter(s(topLevelField) in s(topLevelField=), final,' |
| 85 ' type = Class(s(String) in s(dart.core), top-level))', pm); | 84 ' type = Class(s(String) in s(dart.core), top-level))', pm); |
| 86 | 85 |
| 87 mm = lm.topLevelMembers[#finalTopLevelField]; | 86 mm = lm.topLevelMembers[#finalTopLevelField]; |
| 88 expect('Method(s(finalTopLevelField) in s(test.synthetic_accessor_properties)' | 87 expect('Method(s(finalTopLevelField) in s(test.synthetic_accessor_properties)' |
| 89 ', top-level, synthetic, static, getter)', mm); | 88 ', top-level, synthetic, static, getter)', mm); |
| 90 Expect.equals(reflectClass(double), mm.returnType); | 89 Expect.equals(reflectClass(double), mm.returnType); |
| 91 Expect.listEquals([], mm.parameters); | 90 Expect.listEquals([], mm.parameters); |
| 92 | 91 |
| 93 mm = lm.topLevelMembers[const Symbol('finalTopLevelField=')]; | 92 mm = lm.topLevelMembers[const Symbol('finalTopLevelField=')]; |
| 94 Expect.isNull(mm); | 93 Expect.isNull(mm); |
| 95 | 94 |
| 95 return; /// 01: ok |
| 96 |
| 96 mm = lm.topLevelMembers[#C]; | 97 mm = lm.topLevelMembers[#C]; |
| 97 expect('Method(s(C) in s(test.synthetic_accessor_properties),' | 98 expect('Method(s(C) in s(test.synthetic_accessor_properties),' |
| 98 ' top-level, synthetic, static, getter)', mm); | 99 ' top-level, synthetic, static, getter)', mm); |
| 99 Expect.equals(reflectClass(Type), mm.returnType); | 100 Expect.equals(reflectClass(Type), mm.returnType); |
| 100 Expect.listEquals([], mm.parameters); | 101 Expect.listEquals([], mm.parameters); |
| 101 | 102 |
| 102 mm = lm.topLevelMembers[const Symbol('C=')]; | 103 mm = lm.topLevelMembers[const Symbol('C=')]; |
| 103 Expect.isNull(mm); | 104 Expect.isNull(mm); |
| 104 } | 105 } |
| OLD | NEW |