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

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

Issue 10913133: Allow closures inside lazy initializers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 2 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 | « lib/compiler/implementation/closure.dart ('k') | lib/compiler/implementation/resolver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/elements/elements.dart
diff --git a/lib/compiler/implementation/elements/elements.dart b/lib/compiler/implementation/elements/elements.dart
index 9877fe7daba1d0560bf357351123c8c6eca62e66..2594b087145e86e0f1cc27273207cf5d4f71eb44 100644
--- a/lib/compiler/implementation/elements/elements.dart
+++ b/lib/compiler/implementation/elements/elements.dart
@@ -247,11 +247,7 @@ class Element implements Spannable {
CompilationUnitElement getCompilationUnit() {
Element element = this;
- while (element !== null && !element.isCompilationUnit()) {
- if (element.isLibrary()) {
- LibraryElement library = element;
- return library.entryCompilationUnit;
- }
+ while (!element.isCompilationUnit()) {
element = element.enclosingElement;
}
return element;
@@ -614,6 +610,8 @@ class LibraryElement extends ScopeContainerElement {
LibraryElement get declaration => super.declaration;
LibraryElement get implementation => super.implementation;
+ CompilationUnitElement getCompilationUnit() => entryCompilationUnit;
+
void addCompilationUnit(CompilationUnitElement element) {
compilationUnits = compilationUnits.prepend(element);
}
« no previous file with comments | « lib/compiler/implementation/closure.dart ('k') | lib/compiler/implementation/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698