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

Unified Diff: sdk/lib/_internal/compiler/implementation/elements/modelx.dart

Issue 11967010: Internal libraries supported. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update MockCompiler Created 7 years, 11 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: sdk/lib/_internal/compiler/implementation/elements/modelx.dart
diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
index 5fa9a3b0316a25b7066d8ba49681148919d5e890..ee85139603cb21755b63d0feb0f4d8d18c7392ce 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
@@ -522,7 +522,7 @@ class CompilationUnitElementX extends ElementX
}
class LibraryElementX extends ElementX implements LibraryElement {
- final Uri uri;
+ final Uri canonicalUri;
CompilationUnitElement entryCompilationUnit;
Link<CompilationUnitElement> compilationUnits =
const Link<CompilationUnitElement>();
@@ -564,8 +564,8 @@ class LibraryElementX extends ElementX implements LibraryElement {
*/
Link<Element> slotForExports;
- LibraryElementX(Script script, [Uri uri, LibraryElement this.origin])
- : this.uri = ((uri == null) ? script.uri : uri),
+ LibraryElementX(Script script, [Uri canonicalUri, LibraryElement this.origin])
+ : this.canonicalUri = ((canonicalUri == null) ? script.uri : canonicalUri),
importScope = new Map<SourceString, Element>(),
super(new SourceString(script.name), ElementKind.LIBRARY, null) {
entryCompilationUnit = new CompilationUnitElementX(script, this);
@@ -728,14 +728,17 @@ class LibraryElementX extends ElementX implements LibraryElement {
return libraryTag.name.toString();
} else {
// Use the file name as script name.
- String path = uri.path;
+ String path = canonicalUri.path;
return path.substring(path.lastIndexOf('/') + 1);
}
}
Scope buildScope() => new LibraryScope(this);
- bool get isPlatformLibrary => uri.scheme == "dart";
+ bool get isPlatformLibrary => canonicalUri.scheme == "dart";
+
+ bool get isInternalLibrary =>
+ isPlatformLibrary && canonicalUri.path.startsWith('_');
String toString() {
if (origin != null) {

Powered by Google App Engine
This is Rietveld 408576698