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

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

Issue 1414913002: Introduce .isMalformed (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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
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..07bf748e39118b63d8d20e398dcb9f8168fd9cb7 100644
--- a/pkg/compiler/lib/src/elements/elements.dart
+++ b/pkg/compiler/lib/src/elements/elements.dart
@@ -86,8 +86,6 @@ class ElementKind {
const ElementKind('generative_constructor', ElementCategory.FACTORY);
static const ElementKind FIELD =
const ElementKind('field', ElementCategory.VARIABLE);
- static const ElementKind FIELD_LIST =
- const ElementKind('field_list', ElementCategory.NONE);
Johnni Winther 2015/10/21 07:51:56 Nice!
sigurdm 2015/10/22 07:33:14 Acknowledged.
static const ElementKind GENERATIVE_CONSTRUCTOR_BODY =
const ElementKind('generative_constructor_body', ElementCategory.NONE);
static const ElementKind COMPILATION_UNIT =
@@ -272,7 +270,7 @@ abstract class Element implements Entity {
bool get isInitializingFormal;
/// `true` if this element represents a resolution error.
- bool get isErroneous;
+ bool get isError;
/// `true` if this element represents an ambiguous name.
///
@@ -281,6 +279,10 @@ abstract class Element implements Entity {
/// is produced.
bool get isAmbiguous;
+ /// True if there has been errors during resolution or parsing of this
+ /// element.
+ bool get isMalformed;
+
/// `true` if this element represents an entity whose access causes one or
/// more warnings.
bool get isWarnOnUse;
@@ -422,9 +424,12 @@ abstract class Element implements Entity {
class Elements {
static bool isUnresolved(Element e) {
- return e == null || e.isErroneous;
+ return e == null || e.isMalformed;
+ }
+
+ static bool isMalformed(Element e) {
+ return e != null && e.isMalformed;
}
- static bool isErroneous(Element e) => e != null && e.isErroneous;
/// Unwraps [element] reporting any warnings attached to it, if any.
static Element unwrap(Element element,
@@ -786,7 +791,7 @@ class Elements {
/// or otherwise invalid.
///
/// Accessing any field or calling any method defined on [ErroneousElement]
-/// except [isErroneous] will currently throw an exception. (This might
+/// except [isError] will currently throw an exception. (This might
/// change when we actually want more information on the erroneous element,
/// e.g., the name of the element we were trying to resolve.)
///

Powered by Google App Engine
This is Rietveld 408576698