From 57f4827c7684e0afc466cd035a9bb3ecaa6d2fd7 Mon Sep 17 00:00:00 2001 From: "Lasse R.H. Nielsen" Date: Mon, 12 Oct 2015 16:31:48 +0200 Subject: [PATCH] Rename [packages] to [packageMap] as Isolate.spawnUri parameter. This matches the static [packageMap] getter on Isolate. Fixes issue #24545. BUG= http://dartbug.com/24545 R=floitsch@google.com Review URL: https://codereview.chromium.org/1401713002. --- CHANGELOG.md | 4 ++++ runtime/lib/isolate_patch.dart | 6 +++--- sdk/lib/_internal/js_runtime/lib/isolate_patch.dart | 4 ++-- sdk/lib/isolate/isolate.dart | 10 +++++----- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f9aadfa856..039c5cde309 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,10 @@ was deprecated back in 1.9. Use the `shared` flag when creating listening sockets and `HttpServer` to distribute accepted sockets between isolates. +* `dart:isolate` + * `Isolate` added `packageRoot` and `packageMap` getters. + * `Isolate.spawnUri` added `packageMap` parameter. + ### Tool changes * `docgen` and 'dartdocgen' no longer ship in the sdk. The `docgen` sources have diff --git a/runtime/lib/isolate_patch.dart b/runtime/lib/isolate_patch.dart index 9970d921c75..9e77fa43bb7 100644 --- a/runtime/lib/isolate_patch.dart +++ b/runtime/lib/isolate_patch.dart @@ -331,13 +331,13 @@ patch class Isolate { bool checked, Map environment, Uri packageRoot, - Map packages}) { + Map packageMap}) { RawReceivePort readyPort; if (environment != null) throw new UnimplementedError("environment"); - if (packages != null) throw new UnimplementedError("packages"); + if (packageMap != null) throw new UnimplementedError("packageMap"); try { // The VM will invoke [_startIsolate] and not `main`. - // TODO: Handle [packages]. + // TODO: Handle [packagesMap]. readyPort = new RawReceivePort(); var packageRootString = (packageRoot == null) ? null : packageRoot.toString(); diff --git a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart index 8b8d023e24c..655a51c472a 100644 --- a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart +++ b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart @@ -77,10 +77,10 @@ class Isolate { bool checked, Map environment, Uri packageRoot, - Map packages}) { + Map packageMap}) { if (environment != null) throw new UnimplementedError("environment"); if (packageRoot != null) throw new UnimplementedError("packageRoot"); - if (packages != null) throw new UnimplementedError("packages"); + if (packageMap != null) throw new UnimplementedError("packageMap"); bool forcePause = (errorsAreFatal != null) || (onExit != null) || (onError != null); diff --git a/sdk/lib/isolate/isolate.dart b/sdk/lib/isolate/isolate.dart index d6b4c0b5b41..324c1e3b5b0 100644 --- a/sdk/lib/isolate/isolate.dart +++ b/sdk/lib/isolate/isolate.dart @@ -235,7 +235,7 @@ class Isolate { * * WARNING: The [checked] parameter is not implemented on all platforms yet. * - * If either the [packageRoot] or the [packages] parameter is provided, + * If either the [packageRoot] or the [packageMap] parameter is provided, * it is used to find the location of package sources in the spawned isolate. * * The `packageRoot` URI must be a "file" or "http"/"https" URI that specifies @@ -245,7 +245,7 @@ class Isolate { * resolved against this location, as by * `packageRoot.resolve("foo/bar.dart")`. * - * The `packages` map maps package names to URIs with the same requirements + * The `packageMap` map maps package names to URIs with the same requirements * as `packageRoot`. Package imports (like `"package:foo/bar/baz.dart"`) in * the new isolate are resolved against the URI for that package (if any), * as by `packages["foo"].resolve("bar/baz.dart") @@ -253,11 +253,11 @@ class Isolate { * This resolution also applies to the main entry [uri] * if that happens to be a package-URI. * - * If both [packageRoot] and [packages] are omitted, the new isolate uses + * If both [packageRoot] and [packageMap] are omitted, the new isolate uses * the same package resolution as the current isolate. * It's not allowed to provide both a `packageRoot` and a `package` parameter. * - * WARNING: The [packageRoot] and [packages] parameters are not implemented + * WARNING: The [packageRoot] and [packageMap] parameters are not implemented * on all platforms yet. * * The [environment] is a mapping from strings to strings which the @@ -283,7 +283,7 @@ class Isolate { bool checked, Map environment, Uri packageRoot, - Map packages}); + Map packageMap}); /** * Requests the isolate to pause.