| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 elements; | 5 library elements; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/resolution.dart' show Resolution; | 8 import '../common/resolution.dart' show Resolution; |
| 9 import '../constants/constructors.dart'; | 9 import '../constants/constructors.dart'; |
| 10 import '../constants/expressions.dart'; | 10 import '../constants/expressions.dart'; |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 Node selector = send.selector; | 531 Node selector = send.selector; |
| 532 // this(). | 532 // this(). |
| 533 if (selector.isThis()) return true; | 533 if (selector.isThis()) return true; |
| 534 // (o)() or foo()(). | 534 // (o)() or foo()(). |
| 535 if (element == null && selector.asIdentifier() == null) return true; | 535 if (element == null && selector.asIdentifier() == null) return true; |
| 536 if (element == null) return false; | 536 if (element == null) return false; |
| 537 // foo() with foo a local or a parameter. | 537 // foo() with foo a local or a parameter. |
| 538 return isLocal(element); | 538 return isLocal(element); |
| 539 } | 539 } |
| 540 | 540 |
| 541 static String reconstructConstructorNameSourceString(Element element) { | 541 static String reconstructConstructorNameSourceString(FunctionEntity element) { |
| 542 if (element.name == '') { | 542 if (element.name == '') { |
| 543 return element.enclosingClass.name; | 543 return element.enclosingClass.name; |
| 544 } else { | 544 } else { |
| 545 return reconstructConstructorName(element); | 545 return reconstructConstructorName(element); |
| 546 } | 546 } |
| 547 } | 547 } |
| 548 | 548 |
| 549 // TODO(johnniwinther): Remove this method. | 549 // TODO(johnniwinther): Move this (other similar) to an entity_utils library. |
| 550 static String reconstructConstructorName(Element element) { | 550 static String reconstructConstructorName(FunctionEntity element) { |
| 551 String className = element.enclosingClass.name; | 551 String className = element.enclosingClass.name; |
| 552 if (element.name == '') { | 552 if (element.name == '') { |
| 553 return className; | 553 return className; |
| 554 } else { | 554 } else { |
| 555 return '$className\$${element.name}'; | 555 return '$className\$${element.name}'; |
| 556 } | 556 } |
| 557 } | 557 } |
| 558 | 558 |
| 559 static String constructorNameForDiagnostics( | 559 static String constructorNameForDiagnostics( |
| 560 String className, String constructorName) { | 560 String className, String constructorName) { |
| (...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1977 /// by a field. | 1977 /// by a field. |
| 1978 bool get isDeclaredByField; | 1978 bool get isDeclaredByField; |
| 1979 | 1979 |
| 1980 /// Returns `true` if this member is abstract. | 1980 /// Returns `true` if this member is abstract. |
| 1981 bool get isAbstract; | 1981 bool get isAbstract; |
| 1982 | 1982 |
| 1983 /// If abstract, [implementation] points to the overridden concrete member, | 1983 /// If abstract, [implementation] points to the overridden concrete member, |
| 1984 /// if any. Otherwise [implementation] points to the member itself. | 1984 /// if any. Otherwise [implementation] points to the member itself. |
| 1985 Member get implementation; | 1985 Member get implementation; |
| 1986 } | 1986 } |
| OLD | NEW |