Index: pkg/analyzer/lib/src/generated/testing/element_factory.dart |
diff --git a/pkg/analyzer/lib/src/generated/testing/element_factory.dart b/pkg/analyzer/lib/src/generated/testing/element_factory.dart |
index d5ac50fb1dd0b1566867430dfe3a68c210565f01..2beeab48e4f67018cb3d8a3fccd0d997a665fc5e 100644 |
--- a/pkg/analyzer/lib/src/generated/testing/element_factory.dart |
+++ b/pkg/analyzer/lib/src/generated/testing/element_factory.dart |
@@ -251,6 +251,15 @@ class ElementFactory { |
Identifier name) => |
new FieldFormalParameterElementImpl.forNode(name); |
+ /** |
+ * Destroy any static state retained by [ElementFactory]. This should be |
+ * called from the `setUp` method of any tests that use [ElementFactory], in |
+ * order to ensure that state is not shared between multiple tests. |
+ */ |
+ static void flushStaticState() { |
+ _objectElement = null; |
+ } |
+ |
static FunctionElementImpl functionElement(String functionName) => |
functionElement4(functionName, null, null, null, null); |