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

Unified Diff: sdk/lib/_internal/pub_generated/asset/dart/transformer_isolate.dart

Issue 590393005: Pass a package root to spawned isolates in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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/pub_generated/asset/dart/transformer_isolate.dart
diff --git a/sdk/lib/_internal/pub_generated/asset/dart/transformer_isolate.dart b/sdk/lib/_internal/pub_generated/asset/dart/transformer_isolate.dart
index 1b56f97bd4671cfce51f96f34684ce69ae62ce87..50bb97baac869e1a1ca8666246a6d312158efbed 100644
--- a/sdk/lib/_internal/pub_generated/asset/dart/transformer_isolate.dart
+++ b/sdk/lib/_internal/pub_generated/asset/dart/transformer_isolate.dart
@@ -17,10 +17,6 @@ import 'serialize.dart';
/// Cached to avoid re-instantiating each time a transformer is initialized.
final _mirrors = currentMirrorSystem();
-/// The URI of this library.
-final _baseUri = _mirrors.findLibrary(
- const Symbol('pub.asset.transformer_isolate')).uri;
-
/// Sets up the initial communication with the host isolate.
void loadTransformers(SendPort replyTo) {
var port = new ReceivePort();
@@ -86,7 +82,13 @@ List _initialize(String uri, Map configuration, BarbackMode mode) {
}).where((classMirror) => classMirror != null));
}
- loadFromLibrary(_mirrors.libraries[_baseUri.resolve(uri)]);
+ var library = _mirrors.libraries[Uri.parse(uri)];
+
+ // This should only happen if something's wrong with the logic in pub itself.
+ // If it were user error, the entire isolate would fail to load.
+ if (library == null) throw "Couldn't find library at $uri.";
+
+ loadFromLibrary(library);
return transformers;
}

Powered by Google App Engine
This is Rietveld 408576698