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

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

Issue 10701091: Dartdoc and Apidoc updated to use dart2js through the mirror system. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed cf. rnystrom's comments. Created 8 years, 5 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: lib/compiler/implementation/elements/elements.dart
diff --git a/lib/compiler/implementation/elements/elements.dart b/lib/compiler/implementation/elements/elements.dart
index 5122c65e2cd2fdaf1dc98f92ca50ee7b9fadacde..6736b57ef0d87732f74056afb838ea413bb7c20b 100644
--- a/lib/compiler/implementation/elements/elements.dart
+++ b/lib/compiler/implementation/elements/elements.dart
@@ -145,6 +145,10 @@ class Element implements Hashable {
bool impliesType() => (kind.category & ElementCategory.IMPLIES_TYPE) != 0;
bool isExtendable() => (kind.category & ElementCategory.IS_EXTENDABLE) != 0;
+ // TODO(johnniwinther): This breaks for libraries (for which enclosing
+ // elements are null) and is invalid for top level variable declarations for
+ // which the enclosing element is a VariableDeclarations and not a compilation
+ // unit.
bool isTopLevel() => enclosingElement.isCompilationUnit();
bool isAssignable() {
@@ -213,7 +217,7 @@ class Element implements Hashable {
String toString() {
// TODO(johnniwinther): Test for nullness of name, or make non-nullness an
// invariant for all element types.
- if (!isTopLevel()) {
+ if (enclosingElement !== null && !isTopLevel()) {
String holderName = enclosingElement.name.slowToString();
return '$kind($holderName#${name.slowToString()})';
} else {

Powered by Google App Engine
This is Rietveld 408576698