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 import '../common.dart'; | 5 import '../common.dart'; |
6 import '../common/names.dart' show Identifiers, Names, Selectors; | 6 import '../common/names.dart' show Identifiers, Names, Selectors; |
7 import '../compiler.dart' show Compiler; | 7 import '../compiler.dart' show Compiler; |
8 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
9 import '../tree/tree.dart'; | 9 import '../tree/tree.dart'; |
10 import 'backend.dart'; | 10 import 'backend.dart'; |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 } else if (body is Block && | 212 } else if (body is Block && |
213 !body.statements.isEmpty && | 213 !body.statements.isEmpty && |
214 body.statements.nodes.tail.isEmpty) { | 214 body.statements.nodes.tail.isEmpty) { |
215 Statement stmt = body.statements.nodes.head; | 215 Statement stmt = body.statements.nodes.head; |
216 if (stmt is Return && stmt.hasExpression) { | 216 if (stmt is Return && stmt.hasExpression) { |
217 expr = stmt.expression; | 217 expr = stmt.expression; |
218 } | 218 } |
219 } | 219 } |
220 if (expr is Send && expr.isTypeCast) { | 220 if (expr is Send && expr.isTypeCast) { |
221 Send sendExpr = expr; | 221 Send sendExpr = expr; |
222 var typeAnnotation = sendExpr.typeAnnotationFromIsCheckOrCast; | 222 var typeName = sendExpr.typeAnnotationFromIsCheckOrCast.typeName; |
223 var typeName = typeAnnotation.asNominalTypeAnnotation()?.typeName; | |
224 if (typeName is Identifier && typeName.source == "dynamic") { | 223 if (typeName is Identifier && typeName.source == "dynamic") { |
225 expr = sendExpr.receiver; | 224 expr = sendExpr.receiver; |
226 } | 225 } |
227 } | 226 } |
228 if (expr is Send && | 227 if (expr is Send && |
229 expr.isSuperCall && | 228 expr.isSuperCall && |
230 expr.selector is Identifier && | 229 expr.selector is Identifier && |
231 (expr.selector as Identifier).source == Identifiers.noSuchMethod_) { | 230 (expr.selector as Identifier).source == Identifiers.noSuchMethod_) { |
232 var arg = expr.arguments.head; | 231 var arg = expr.arguments.head; |
233 if (expr.arguments.tail.isEmpty && | 232 if (expr.arguments.tail.isEmpty && |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 return false; | 266 return false; |
268 } | 267 } |
269 } | 268 } |
270 | 269 |
271 enum NsmCategory { | 270 enum NsmCategory { |
272 DEFAULT, | 271 DEFAULT, |
273 THROWING, | 272 THROWING, |
274 NOT_APPLICABLE, | 273 NOT_APPLICABLE, |
275 OTHER, | 274 OTHER, |
276 } | 275 } |
OLD | NEW |