| 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 | 7 |
| 8 import '../constants/expressions.dart'; | 8 import '../constants/expressions.dart'; |
| 9 import '../tree/tree.dart'; | 9 import '../tree/tree.dart'; |
| 10 import '../util/util.dart'; | 10 import '../util/util.dart'; |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 | 342 |
| 343 Token get position; | 343 Token get position; |
| 344 | 344 |
| 345 CompilationUnitElement get compilationUnit; | 345 CompilationUnitElement get compilationUnit; |
| 346 LibraryElement get library; | 346 LibraryElement get library; |
| 347 LibraryElement get implementationLibrary; | 347 LibraryElement get implementationLibrary; |
| 348 ClassElement get enclosingClass; | 348 ClassElement get enclosingClass; |
| 349 Element get enclosingClassOrCompilationUnit; | 349 Element get enclosingClassOrCompilationUnit; |
| 350 Element get outermostEnclosingMemberOrTopLevel; | 350 Element get outermostEnclosingMemberOrTopLevel; |
| 351 | 351 |
| 352 // TODO(johnniwinther): Replace uses of this with [enclosingClass] when |
| 353 // [ClosureClassElement] has been removed. |
| 352 /// The enclosing class that defines the type environment for this element. | 354 /// The enclosing class that defines the type environment for this element. |
| 353 ClassElement get contextClass; | 355 ClassElement get contextClass; |
| 354 | 356 |
| 355 FunctionElement asFunctionElement(); | 357 FunctionElement asFunctionElement(); |
| 356 | 358 |
| 357 /// Is [:true:] if this element has a corresponding patch. | 359 /// Is [:true:] if this element has a corresponding patch. |
| 358 /// | 360 /// |
| 359 /// If [:true:] this element has a non-null [patch] field. | 361 /// If [:true:] this element has a non-null [patch] field. |
| 360 /// | 362 /// |
| 361 /// See [:patch_parser.dart:] for a description of the terminology. | 363 /// See [:patch_parser.dart:] for a description of the terminology. |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 /// [LocalParameterElement] whereas initializing formals, that is parameter of | 1048 /// [LocalParameterElement] whereas initializing formals, that is parameter of |
| 1047 /// the form `this.x`, are modeled by [InitializingFormalParameter]. | 1049 /// the form `this.x`, are modeled by [InitializingFormalParameter]. |
| 1048 abstract class ParameterElement extends Element | 1050 abstract class ParameterElement extends Element |
| 1049 implements VariableElement, FormalElement, LocalElement { | 1051 implements VariableElement, FormalElement, LocalElement { |
| 1050 /// Use [functionDeclaration] instead. | 1052 /// Use [functionDeclaration] instead. |
| 1051 @deprecated | 1053 @deprecated |
| 1052 get enclosingElement; | 1054 get enclosingElement; |
| 1053 | 1055 |
| 1054 /// The function on which this parameter is declared. | 1056 /// The function on which this parameter is declared. |
| 1055 FunctionElement get functionDeclaration; | 1057 FunctionElement get functionDeclaration; |
| 1058 |
| 1059 /// `true` if this parameter is named. |
| 1060 bool get isNamed; |
| 1061 |
| 1062 /// `true` if this parameter is optional. |
| 1063 bool get isOptional; |
| 1056 } | 1064 } |
| 1057 | 1065 |
| 1058 /// A formal parameter on a function or constructor that introduces a local | 1066 /// A formal parameter on a function or constructor that introduces a local |
| 1059 /// variable in the scope of the function or constructor. | 1067 /// variable in the scope of the function or constructor. |
| 1060 abstract class LocalParameterElement extends ParameterElement | 1068 abstract class LocalParameterElement extends ParameterElement |
| 1061 implements LocalVariableElement { | 1069 implements LocalVariableElement { |
| 1062 } | 1070 } |
| 1063 | 1071 |
| 1064 /// A formal parameter in a constructor that directly initializes a field. | 1072 /// A formal parameter in a constructor that directly initializes a field. |
| 1065 /// | 1073 /// |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1126 /// Do not use [computeSignature] outside of the resolver; instead retrieve | 1134 /// Do not use [computeSignature] outside of the resolver; instead retrieve |
| 1127 /// the signature through the [functionSignature] field. | 1135 /// the signature through the [functionSignature] field. |
| 1128 /// Trying to access a function signature that has not been computed in | 1136 /// Trying to access a function signature that has not been computed in |
| 1129 /// resolution is an error and calling [computeSignature] covers that error. | 1137 /// resolution is an error and calling [computeSignature] covers that error. |
| 1130 /// This method will go away! | 1138 /// This method will go away! |
| 1131 // TODO(johnniwinther): Rename to `ensureFunctionSignature`. | 1139 // TODO(johnniwinther): Rename to `ensureFunctionSignature`. |
| 1132 @deprecated FunctionSignature computeSignature(Compiler compiler); | 1140 @deprecated FunctionSignature computeSignature(Compiler compiler); |
| 1133 | 1141 |
| 1134 bool get hasFunctionSignature; | 1142 bool get hasFunctionSignature; |
| 1135 | 1143 |
| 1144 /// The parameters of this functions. |
| 1145 List<ParameterElement> get parameters; |
| 1146 |
| 1136 /// The type of this function. | 1147 /// The type of this function. |
| 1137 FunctionType get type; | 1148 FunctionType get type; |
| 1138 | 1149 |
| 1139 /// The synchronous/asynchronous marker on this function. | 1150 /// The synchronous/asynchronous marker on this function. |
| 1140 AsyncMarker get asyncMarker; | 1151 AsyncMarker get asyncMarker; |
| 1141 | 1152 |
| 1142 /// `true` if this function is external. | 1153 /// `true` if this function is external. |
| 1143 bool get isExternal; | 1154 bool get isExternal; |
| 1144 } | 1155 } |
| 1145 | 1156 |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1613 bool get isDeclaredByField; | 1624 bool get isDeclaredByField; |
| 1614 | 1625 |
| 1615 /// Returns `true` if this member is abstract. | 1626 /// Returns `true` if this member is abstract. |
| 1616 bool get isAbstract; | 1627 bool get isAbstract; |
| 1617 | 1628 |
| 1618 /// If abstract, [implementation] points to the overridden concrete member, | 1629 /// If abstract, [implementation] points to the overridden concrete member, |
| 1619 /// if any. Otherwise [implementation] points to the member itself. | 1630 /// if any. Otherwise [implementation] points to the member itself. |
| 1620 Member get implementation; | 1631 Member get implementation; |
| 1621 } | 1632 } |
| 1622 | 1633 |
| OLD | NEW |