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

Unified Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 2003863002: Issue 26466. Limited fix to pass on the dart:html test case. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rollback the SDK change. Created 4 years, 7 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/lib/src/generated/resolver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 721918f655b3c41c20556433c6c7fbce2d5c2916..43cda9ec5fcc39eaf510d2f94ab1cfa93d0b6ba0 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -3976,6 +3976,11 @@ class LibraryElementImpl extends ElementImpl implements LibraryElement {
Namespace _publicNamespace;
/**
+ * A bit-encoded form of the capabilities associated with this library.
+ */
+ int _resolutionCapabilities = 0;
+
+ /**
* Initialize a newly created library element in the given [context] to have
* the given [name] and [offset].
*/
@@ -4002,6 +4007,10 @@ class LibraryElementImpl extends ElementImpl implements LibraryElement {
: super.forSerialized(null) {
_name = name;
_nameOffset = offset;
+ setResolutionCapability(
+ LibraryResolutionCapability.resolvedTypeNames, true);
+ setResolutionCapability(
+ LibraryResolutionCapability.constantExpressions, true);
}
@override
@@ -4507,6 +4516,16 @@ class LibraryElementImpl extends ElementImpl implements LibraryElement {
return _safeIsUpToDate(this, timeStamp, visitedLibraries);
}
+ /**
+ * Set whether the library has the given [capability] to
+ * correspond to the given [value].
+ */
+ void setResolutionCapability(
+ LibraryResolutionCapability capability, bool value) {
+ _resolutionCapabilities =
+ BooleanArray.set(_resolutionCapabilities, capability.index, value);
+ }
+
@override
void visitChildren(ElementVisitor visitor) {
super.visitChildren(visitor);
@@ -4547,6 +4566,15 @@ class LibraryElementImpl extends ElementImpl implements LibraryElement {
}
/**
+ * Return `true` if the [library] has the given [capability].
+ */
+ static bool hasResolutionCapability(
+ LibraryElement library, LibraryResolutionCapability capability) {
+ return library is LibraryElementImpl &&
+ BooleanArray.get(library._resolutionCapabilities, capability.index);
+ }
+
+ /**
* Return `true` if the given [library] is up to date with respect to the
* given [timeStamp]. The set of [visitedLibraries] is used to prevent
* infinite recursion in the case of mutually dependent libraries.
@@ -4586,6 +4614,22 @@ class LibraryElementImpl extends ElementImpl implements LibraryElement {
}
/**
+ * Enum of possible resolution capabilities that a [LibraryElementImpl] has.
+ */
+enum LibraryResolutionCapability {
+ /**
+ * All elements have their types resolved.
+ */
+ resolvedTypeNames,
+
+ /**
+ * All (potentially) constants expressions are set into corresponding
+ * elements.
+ */
+ constantExpressions,
+}
+
+/**
* The context in which the library is resynthesized.
*/
abstract class LibraryResynthesizerContext {
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698