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.
This commit is contained in:
Lasse R.H. Nielsen 2015-10-12 16:31:48 +02:00
parent 6cc9b43535
commit 57f4827c76
4 changed files with 14 additions and 10 deletions

View file

@ -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

View file

@ -331,13 +331,13 @@ patch class Isolate {
bool checked,
Map<String, String> environment,
Uri packageRoot,
Map<String, Uri> packages}) {
Map<String, Uri> 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();

View file

@ -77,10 +77,10 @@ class Isolate {
bool checked,
Map<String, String> environment,
Uri packageRoot,
Map<String, Uri> packages}) {
Map<String, Uri> 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);

View file

@ -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<String, String> environment,
Uri packageRoot,
Map<String, Uri> packages});
Map<String, Uri> packageMap});
/**
* Requests the isolate to pause.