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

Unified Diff: sdk/lib/_internal/compiler/implementation/elements/elements.dart

Issue 562123002: Support parameter access in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/elements/elements.dart
diff --git a/sdk/lib/_internal/compiler/implementation/elements/elements.dart b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
index 6c4266495ad103873995d7d46f85f4fa33937004..0b6c7f8ada1b16e20f5177915284818a110b769e 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/elements.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
@@ -333,6 +333,10 @@ abstract class Element implements Entity {
/// is declared `static`.
bool get isStatic;
+ /// `true` if this element is local element, that is, a local variable,
+ /// local function or parameter.
+ bool get isLocal;
+
bool get impliesType;
Token get position;
@@ -443,13 +447,7 @@ class Elements {
}
static bool isLocal(Element element) {
- return !Elements.isUnresolved(element)
- && !element.isInstanceMember
- && !isStaticOrTopLevelField(element)
- && !isStaticOrTopLevelFunction(element)
- && (identical(element.kind, ElementKind.VARIABLE) ||
- identical(element.kind, ElementKind.PARAMETER) ||
- identical(element.kind, ElementKind.FUNCTION));
+ return !Elements.isUnresolved(element) && element.isLocal;
}
static bool isInstanceField(Element element) {
@@ -1050,6 +1048,10 @@ abstract class FormalElement extends Element
/// the form `this.x`, are modeled by [InitializingFormalParameter].
abstract class ParameterElement extends Element
implements VariableElement, FormalElement, LocalElement {
+ /// Use [functionDeclaration] instead.
+ @deprecated
+ get enclosingElement;
+
/// The function on which this parameter is declared.
FunctionElement get functionDeclaration;
}

Powered by Google App Engine
This is Rietveld 408576698