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

Unified Diff: pkg/analyzer/lib/src/generated/testing/element_factory.dart

Issue 1752023002: Clear static ElementFactory state at the start of all resolver tests. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698