Index: pkg/analyzer/lib/src/dart/element/element.dart |
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart |
index 0636e28a842d47da4bfd8b3cd183b25a2d2b20da..cb194b0261d713bb450c24e07da64898b70516fb 100644 |
--- a/pkg/analyzer/lib/src/dart/element/element.dart |
+++ b/pkg/analyzer/lib/src/dart/element/element.dart |
@@ -2465,6 +2465,12 @@ class ElementAnnotationImpl implements ElementAnnotation { |
static String _FACTORY_VARIABLE_NAME = "factory"; |
/** |
+ * The name of the top-level variable used to mark a class and its subclasses |
+ * as being immutable. |
+ */ |
+ static String _IMMUTABLE_VARIABLE_NAME = "immutable"; |
+ |
+ /** |
* The name of the class used to JS annotate an element. |
*/ |
static String _JS_CLASS_NAME = "JS"; |
@@ -2584,6 +2590,12 @@ class ElementAnnotationImpl implements ElementAnnotation { |
element.library?.name == _META_LIB_NAME; |
@override |
+ bool get isImmutable => |
+ element is PropertyAccessorElement && |
+ element.name == _IMMUTABLE_VARIABLE_NAME && |
+ element.library?.name == _META_LIB_NAME; |
+ |
+ @override |
bool get isJS => |
element is ConstructorElement && |
element.enclosingElement.name == _JS_CLASS_NAME && |