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

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: create-sdk.py updated 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 ad690789f5fbb8c414a1ab6995d0c5cfe0b77fdc..923c858d400feee9a9ec2fd53f1ab2ffeb179b6e 100644
--- a/lib/compiler/implementation/elements/elements.dart
+++ b/lib/compiler/implementation/elements/elements.dart
@@ -139,6 +139,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() {
@@ -207,7 +211,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