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

Unified Diff: sdk/lib/_internal/compiler/implementation/elements/elements.dart

Issue 548253003: First end-to-end capability in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 3 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: sdk/lib/_internal/compiler/implementation/elements/elements.dart
diff --git a/sdk/lib/_internal/compiler/implementation/elements/elements.dart b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
index 19a3dfeb04fd73b3cded5aff4d8f18106e4770ec..0799ca49a8d24a8c778a02a69e246aeb4a5c8c04 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/elements.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
@@ -25,6 +25,7 @@ import '../dart2jslib.dart' show InterfaceType,
isPrivateName;
import '../dart_types.dart';
+import '../helpers/helpers.dart';
import '../scanner/scannerlib.dart' show Token,
isUserDefinableOperator,
@@ -460,14 +461,13 @@ class Elements {
}
static bool isStaticOrTopLevel(Element element) {
- // TODO(ager): This should not be necessary when patch support has
- // been reworked.
- if (!Elements.isUnresolved(element)
- && element.isStatic) {
- return true;
- }
- return !Elements.isUnresolved(element)
- && !element.isAmbiguous
+ // TODO(johnniwinther): Clean this up. This currently returns true for a
+ // PartialConstructorElement, SynthesizedConstructorElementX, and
+ // TypeVariableElementX though neither `element.isStatic` nor
+ // `element.isTopLevel` is true.
+ if (Elements.isUnresolved(element)) return false;
+ if (element.isStatic || element.isTopLevel) return true;
+ return !element.isAmbiguous
&& !element.isInstanceMember
&& !element.isPrefix
&& element.enclosingElement != null
@@ -855,6 +855,10 @@ abstract class LibraryElement extends Element
* libraries the canonical uri is of the form [:dart:x:].
*/
Uri get canonicalUri;
+
+ /// Returns `true` if this library is 'dart:core'.
+ bool get isDartCore;
+
CompilationUnitElement get entryCompilationUnit;
Link<CompilationUnitElement> get compilationUnits;
Iterable<LibraryTag> get tags;

Powered by Google App Engine
This is Rietveld 408576698