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

Unified Diff: sdk/lib/_internal/lib/js_mirrors.dart

Issue 371553002: Hide the URIs in minified mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update comment and remove type annotation that wasn't imported. Created 6 years, 5 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/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;

Powered by Google App Engine
This is Rietveld 408576698