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

Unified Diff: pkg/compiler/lib/src/elements/elements.dart

Issue 1417103002: Add ElementKind for factory constructors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 2 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
« no previous file with comments | « pkg/compiler/lib/src/elements/common.dart ('k') | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/elements/elements.dart
diff --git a/pkg/compiler/lib/src/elements/elements.dart b/pkg/compiler/lib/src/elements/elements.dart
index 60fcb20f2663e0b8141bc271a121e0dfe9e8b9f3..1a659289b9e1699c86c24e93d0345fb74d1a0c45 100644
--- a/pkg/compiler/lib/src/elements/elements.dart
+++ b/pkg/compiler/lib/src/elements/elements.dart
@@ -84,6 +84,8 @@ class ElementKind {
const ElementKind('class', ElementCategory.CLASS);
static const ElementKind GENERATIVE_CONSTRUCTOR =
const ElementKind('generative_constructor', ElementCategory.FACTORY);
+ static const ElementKind FACTORY_CONSTRUCTOR =
+ const ElementKind('factory_constructor', ElementCategory.FACTORY);
static const ElementKind FIELD =
const ElementKind('field', ElementCategory.VARIABLE);
static const ElementKind FIELD_LIST =
@@ -212,8 +214,8 @@ abstract class Element implements Entity {
/// `true` if this element is a top level function, static or instance
/// method, local function or closure defined by a function expression.
///
- /// This property is `true` for operator methods and factory constructors but
- /// `false` for getter and setter methods, and generative constructors.
+ /// This property is `true` for operator methods but `false` for getter and
+ /// setter methods, and generative and factory constructors.
///
/// See also [isConstructor], [isGenerativeConstructor], and
/// [isFactoryConstructor] for constructor properties, and [isAccessor],
@@ -499,8 +501,7 @@ class Elements {
}
static bool isStaticOrTopLevelFunction(Element element) {
- return isStaticOrTopLevel(element)
- && (identical(element.kind, ElementKind.FUNCTION));
+ return isStaticOrTopLevel(element) && element.isFunction;
}
static bool isInstanceMethod(Element element) {
« no previous file with comments | « pkg/compiler/lib/src/elements/common.dart ('k') | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698