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

Unified Diff: runtime/bin/builtin.dart

Issue 1403693002: - Implement package map parameter when spawning isolate. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review comments. Created 5 years, 2 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 | runtime/bin/dartutils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/builtin.dart
diff --git a/runtime/bin/builtin.dart b/runtime/bin/builtin.dart
index 8ee15ce85e8f0cc82716c0d4a651d91fefaf26ed..d6d945eb48e4b4e23fc73235e8fb2ef47dad985b 100644
--- a/runtime/bin/builtin.dart
+++ b/runtime/bin/builtin.dart
@@ -514,6 +514,34 @@ void _loadPackagesMap(String packagesParam) {
}
+// Embedder Entrypoint:
+// Add mapping from package name to URI.
+void _addPackageMapEntry(String key, String value) {
+ if (!_setupCompleted) {
+ _setupHooks();
+ }
+ if (_traceLoading) {
+ _log("Adding packages map entry: $key -> $value");
+ }
+ if (_packageRoot != null) {
+ if (_traceLoading) {
+ _log("_packageRoot already set: $_packageRoot");
+ }
+ throw "Cannot add package map entry to an exisiting package root.";
+ }
+ if (_packagesPort != null) {
+ if (_traceLoading) {
+ _log("Package map load request already pending.");
+ }
+ throw "Cannot add package map entry during package map resolution.";
+ }
+ if (_packageMap == null) {
+ _packageMap = new Map<String, Uri>();
+ }
+ _packageMap[key] = _workingDirectory.resolve(value);
+}
+
+
void _asyncLoadError(_LoadRequest req, _LoadError error, StackTrace stack) {
if (_traceLoading) {
_log("_asyncLoadError(${req._uri}), error: $error\nstack: $stack");
« no previous file with comments | « no previous file | runtime/bin/dartutils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698