OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 part of dart2js.semantics_visitor_test; | 5 part of dart2js.semantics_visitor_test; |
6 | 6 |
7 const Map<String, List<Test>> SEND_TESTS = const { | 7 const Map<String, List<Test>> SEND_TESTS = const { |
8 'Parameters': const [ | 8 'Parameters': const [ |
9 // Parameters | 9 // Parameters |
10 const Test('m(o) => o;', | 10 const Test('m(o) => o;', |
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 const Visit(VisitKind.VISIT_THIS_GET)), | 1100 const Visit(VisitKind.VISIT_THIS_GET)), |
1101 const Test.clazz( | 1101 const Test.clazz( |
1102 ''' | 1102 ''' |
1103 class C { | 1103 class C { |
1104 call(a, b) {} | 1104 call(a, b) {} |
1105 m() { this(null, 42); } | 1105 m() { this(null, 42); } |
1106 } | 1106 } |
1107 ''', | 1107 ''', |
1108 const Visit(VisitKind.VISIT_THIS_INVOKE, | 1108 const Visit(VisitKind.VISIT_THIS_INVOKE, |
1109 arguments: '(null,42)')), | 1109 arguments: '(null,42)')), |
1110 const Test.clazz( | |
1111 ''' | |
1112 class C { | |
1113 call(a, b) {} | |
1114 static m() { this(null, 42); } | |
1115 } | |
1116 ''', | |
1117 const Visit(VisitKind.ERROR_INVALID_INVOKE, | |
1118 error: MessageKind.NO_THIS_AVAILABLE, | |
1119 arguments: '(null,42)')), | |
1120 ], | 1110 ], |
1121 'This properties': const [ | 1111 'This properties': const [ |
1122 // This properties | 1112 // This properties |
1123 const Test.clazz( | 1113 const Test.clazz( |
1124 ''' | 1114 ''' |
1125 class C { | 1115 class C { |
1126 var foo; | 1116 var foo; |
1127 m() => foo; | 1117 m() => foo; |
1128 } | 1118 } |
1129 ''', | 1119 ''', |
(...skipping 13 matching lines...) Expand all Loading... |
1143 class C { | 1133 class C { |
1144 get foo => null; | 1134 get foo => null; |
1145 m() => foo; | 1135 m() => foo; |
1146 } | 1136 } |
1147 ''', | 1137 ''', |
1148 const Visit(VisitKind.VISIT_THIS_PROPERTY_GET, | 1138 const Visit(VisitKind.VISIT_THIS_PROPERTY_GET, |
1149 name: 'foo')), | 1139 name: 'foo')), |
1150 const Test.clazz( | 1140 const Test.clazz( |
1151 ''' | 1141 ''' |
1152 class C { | 1142 class C { |
1153 var foo; | |
1154 static m() => this.foo; | |
1155 } | |
1156 ''', | |
1157 const Visit(VisitKind.ERROR_INVALID_GET, | |
1158 error: MessageKind.NO_THIS_AVAILABLE)), | |
1159 const Test.clazz( | |
1160 ''' | |
1161 class C { | |
1162 get foo => null; | 1143 get foo => null; |
1163 m() => this.foo; | 1144 m() => this.foo; |
1164 } | 1145 } |
1165 ''', | 1146 ''', |
1166 const Visit(VisitKind.VISIT_THIS_PROPERTY_GET, | 1147 const Visit(VisitKind.VISIT_THIS_PROPERTY_GET, |
1167 name: 'foo')), | 1148 name: 'foo')), |
1168 const Test.clazz( | 1149 const Test.clazz( |
1169 ''' | 1150 ''' |
1170 class C { | 1151 class C { |
1171 var foo; | 1152 var foo; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1218 const Test.clazz( | 1199 const Test.clazz( |
1219 ''' | 1200 ''' |
1220 class C { | 1201 class C { |
1221 var foo; | 1202 var foo; |
1222 m() { this.foo(null, 42); } | 1203 m() { this.foo(null, 42); } |
1223 } | 1204 } |
1224 ''', | 1205 ''', |
1225 const Visit(VisitKind.VISIT_THIS_PROPERTY_INVOKE, | 1206 const Visit(VisitKind.VISIT_THIS_PROPERTY_INVOKE, |
1226 name: 'foo', | 1207 name: 'foo', |
1227 arguments: '(null,42)')), | 1208 arguments: '(null,42)')), |
1228 const Test.clazz( | |
1229 ''' | |
1230 class C { | |
1231 var foo; | |
1232 static m() { this.foo(null, 42); } | |
1233 } | |
1234 ''', | |
1235 const Visit(VisitKind.ERROR_INVALID_INVOKE, | |
1236 error: MessageKind.NO_THIS_AVAILABLE, | |
1237 arguments: '(null,42)')), | |
1238 ], | 1209 ], |
1239 'Super fields': const [ | 1210 'Super fields': const [ |
1240 // Super fields | 1211 // Super fields |
1241 const Test.clazz( | 1212 const Test.clazz( |
1242 ''' | 1213 ''' |
1243 class B { | 1214 class B { |
1244 var o; | 1215 var o; |
1245 } | 1216 } |
1246 class C extends B { | 1217 class C extends B { |
1247 m() => super.o; | 1218 m() => super.o; |
(...skipping 2739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3987 rhs: '42')), | 3958 rhs: '42')), |
3988 const Test.prefix( | 3959 const Test.prefix( |
3989 ''' | 3960 ''' |
3990 var o; | 3961 var o; |
3991 ''', | 3962 ''', |
3992 'm() => p?.o;', | 3963 'm() => p?.o;', |
3993 const Visit(VisitKind.ERROR_INVALID_GET, | 3964 const Visit(VisitKind.ERROR_INVALID_GET, |
3994 error: MessageKind.PREFIX_AS_EXPRESSION)), | 3965 error: MessageKind.PREFIX_AS_EXPRESSION)), |
3995 ], | 3966 ], |
3996 }; | 3967 }; |
OLD | NEW |