Index: sdk/lib/_internal/lib/js_mirrors.dart |
diff --git a/sdk/lib/_internal/lib/js_mirrors.dart b/sdk/lib/_internal/lib/js_mirrors.dart |
index 4cbdaf93281f8703d6a3e81fc6b32e2bf5d18164..b4a250d4a28c02cd7c7a341898906344f1f648e5 100644 |
--- a/sdk/lib/_internal/lib/js_mirrors.dart |
+++ b/sdk/lib/_internal/lib/js_mirrors.dart |
@@ -64,6 +64,14 @@ disableTreeShaking() => preserveNames(); |
/// preserved at runtime. |
preserveMetadata() {} |
+/// No-op method that is called to inform the compiler that the compiler must |
+/// preserve the URIs. |
+preserveUris() {} |
+ |
+/// No-op method that is called to inform the compiler that the compiler must |
+/// preserve the library names. |
+preserveLibraryNames() {} |
+ |
String getName(Symbol symbol) { |
preserveNames(); |
return n(symbol); |
@@ -278,7 +286,7 @@ class JsTypeMirror extends JsDeclarationMirror implements TypeMirror { |
class JsLibraryMirror extends JsDeclarationMirror with JsObjectMirror |
implements LibraryMirror { |
- final Uri uri; |
+ final Uri _uri; |
final List<String> _classes; |
final List<String> _functions; |
final List _metadata; |
@@ -297,17 +305,24 @@ class JsLibraryMirror extends JsDeclarationMirror with JsObjectMirror |
UnmodifiableListView<InstanceMirror> _cachedMetadata; |
JsLibraryMirror(Symbol simpleName, |
- this.uri, |
+ this._uri, |
this._classes, |
this._functions, |
this._metadata, |
this._compactFieldSpecification, |
this._isRoot, |
this._globalObject) |
- : super(simpleName); |
+ : super(simpleName) { |
+ preserveLibraryNames(); |
+ } |
String get _prettyName => 'LibraryMirror'; |
+ Uri get uri { |
+ preserveUris(); |
+ return _uri; |
+ } |
+ |
Symbol get qualifiedName => simpleName; |
List<JsMethodMirror> get _methods => _functionMirrors; |