Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: pkg/compiler/lib/src/js_backend/no_such_method_registry.dart

Issue 2567133002: Add support for the new function-type syntax. (Closed)
Patch Set: Fixes after rebase. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 typeName = sendExpr.typeAnnotationFromIsCheckOrCast.typeName; 222 var typeAnnotation = sendExpr.typeAnnotationFromIsCheckOrCast;
223 var typeName = typeAnnotation.asNominalTypeAnnotation()?.typeName;
223 if (typeName is Identifier && typeName.source == "dynamic") { 224 if (typeName is Identifier && typeName.source == "dynamic") {
224 expr = sendExpr.receiver; 225 expr = sendExpr.receiver;
225 } 226 }
226 } 227 }
227 if (expr is Send && 228 if (expr is Send &&
228 expr.isSuperCall && 229 expr.isSuperCall &&
229 expr.selector is Identifier && 230 expr.selector is Identifier &&
230 (expr.selector as Identifier).source == Identifiers.noSuchMethod_) { 231 (expr.selector as Identifier).source == Identifiers.noSuchMethod_) {
231 var arg = expr.arguments.head; 232 var arg = expr.arguments.head;
232 if (expr.arguments.tail.isEmpty && 233 if (expr.arguments.tail.isEmpty &&
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 return false; 267 return false;
267 } 268 }
268 } 269 }
269 270
270 enum NsmCategory { 271 enum NsmCategory {
271 DEFAULT, 272 DEFAULT,
272 THROWING, 273 THROWING,
273 NOT_APPLICABLE, 274 NOT_APPLICABLE,
274 OTHER, 275 OTHER,
275 } 276 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698