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

Unified Diff: pkg/analyzer/lib/src/generated/element.dart

Issue 1125123006: Add a "librarySource" field to CompilationUnitElementImpl. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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 | « no previous file | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/element.dart
diff --git a/pkg/analyzer/lib/src/generated/element.dart b/pkg/analyzer/lib/src/generated/element.dart
index 0339712ff4cf5321a837b2c5fe0e2f73d1e8c9e6..afa654ebb393593bba3353646124a00bfd4c94a1 100644
--- a/pkg/analyzer/lib/src/generated/element.dart
+++ b/pkg/analyzer/lib/src/generated/element.dart
@@ -1276,6 +1276,15 @@ class CompilationUnitElementImpl extends UriReferencedElementImpl
Source source;
/**
+ * The source of the library containing this compilation unit.
+ *
+ * This is the same as the source of the containing [LibraryElement],
+ * except that it does not require the containing [LibraryElement] to be
+ * computed.
+ */
+ Source librarySource;
+
+ /**
* A list containing all of the top-level accessors (getters and setters)
* contained in this compilation unit.
*/
@@ -7019,6 +7028,7 @@ class LibraryElementImpl extends ElementImpl implements LibraryElement {
* [unit].
*/
void set definingCompilationUnit(CompilationUnitElement unit) {
+ assert((unit as CompilationUnitElementImpl).librarySource == unit.source);
(unit as CompilationUnitElementImpl).enclosingElement = this;
this._definingCompilationUnit = unit;
}
@@ -7210,6 +7220,8 @@ class LibraryElementImpl extends ElementImpl implements LibraryElement {
*/
void set parts(List<CompilationUnitElement> parts) {
for (CompilationUnitElement compilationUnit in parts) {
+ assert((compilationUnit as CompilationUnitElementImpl).librarySource ==
+ source);
(compilationUnit as CompilationUnitElementImpl).enclosingElement = this;
}
this._parts = parts;
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698