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

Unified Diff: lib/compiler/implementation/dart_backend/backend.dart

Issue 10834243: Reduce usage of .enclosingElement to get enclosing class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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/dart_backend/backend.dart
diff --git a/lib/compiler/implementation/dart_backend/backend.dart b/lib/compiler/implementation/dart_backend/backend.dart
index ac03dfe86c7658f555d6a303d7397fb7859583d2..2774e2a72006daf32701e47f0e9112adcb8153a1 100644
--- a/lib/compiler/implementation/dart_backend/backend.dart
+++ b/lib/compiler/implementation/dart_backend/backend.dart
@@ -40,7 +40,7 @@ class DartBackend extends Backend {
*/
void addMemberToClass(Element element, ClassElement classElement) {
// ${element} should have ${classElement} as enclosing.
- assert(element.enclosingElement == classElement);
+ assert(element.isMember());
Set<Element> resolvedElementsInClass = resolvedClassMembers.putIfAbsent(
classElement, () => new Set<Element>());
resolvedElementsInClass.add(element);
@@ -74,7 +74,7 @@ class DartBackend extends Backend {
resolvedElements.forEach((element, treeElements) {
if (!shouldOutput(element)) return;
if (element.isMember()) {
- var enclosingClass = element.enclosingElement;
+ ClassElement enclosingClass = element.getEnclosingClass();
assert(enclosingClass.isClass());
assert(enclosingClass.isTopLevel());
addMemberToClass(element, enclosingClass);

Powered by Google App Engine
This is Rietveld 408576698