Chromium Code Reviews| Index: sdk/lib/isolate/isolate.dart |
| diff --git a/sdk/lib/isolate/isolate.dart b/sdk/lib/isolate/isolate.dart |
| index 96c55b814835208dac713970baf062873c23be16..795940b63f30d2153b7a5bdce735673e5da4fd4a 100644 |
| --- a/sdk/lib/isolate/isolate.dart |
| +++ b/sdk/lib/isolate/isolate.dart |
| @@ -106,11 +106,27 @@ class Isolate { |
| * When present, the parameter `args` is set to the provided [args] list. |
| * When present, the parameter `message` is set to the initial [message]. |
| * |
| + * If the [packageRoot] parameter is passed, it is used as the location |
| + * of packages in the spawned isolate. |
| + * The `packageRoot` URI must be a "file" or "http"/"https" URI that ends |
| + * in a slash. |
| + * If it doesn't end in a slash, one will be added before using the URI. |
|
Anders Johnsen
2014/08/04 12:54:48
I don't agree with this. Normally we would use Uri
Lasse Reichstein Nielsen
2014/08/04 13:27:26
The user will never want to write "file:///foo/bar
Anders Johnsen
2014/08/05 06:23:29
If I give it Platform.script, I expect it to work,
Lasse Reichstein Nielsen
2014/08/05 08:01:25
If we make new Uri.file(directory.path) end in a s
Lasse Reichstein Nielsen
2014/08/05 12:50:37
The --package-root argument on the VM command line
|
| + * Package URIs (like "package:foo/bar.dart") in the new isolate are |
|
Anders Johnsen
2014/08/04 12:54:48
URIs -> imports
|
| + * resolved against this location, as by |
| + * `packageRoot.resolve(Uri.parse("foo/bar.dart"))`. |
|
Anders Johnsen
2014/08/04 12:54:48
This is contradicting the 'adding slash' as stated
Lasse Reichstein Nielsen
2014/08/04 13:27:26
True. It assumes the presence of the trailing slas
Lasse Reichstein Nielsen
2014/08/13 08:06:05
How about requiring the path to end in a slash, an
floitsch
2014/08/15 18:32:32
I think the packageRoot should behave similar to h
Lasse Reichstein Nielsen
2014/08/21 11:14:01
Agree. The URI must refer to a directory. If the p
|
| + * This includes the main entry [uri] if it happens to be a package-URL. |
| + * If [packageRoot] is omitted, the spawned isolate will use the same |
| + * package root as the spawning isolate. |
| + * |
| * Returns a future that will complete with an [Isolate] instance if the |
| * spawning succeeded. It will complete with an error otherwise. |
| */ |
| external static Future<Isolate> spawnUri( |
| - Uri uri, List<String> args, var message, { bool paused: false }); |
| + Uri uri, |
| + List<String> args, |
| + var message, |
| + { bool paused: false, |
| + Uri packageRoot }); |
| /** |
| * Requests the isolate to pause. |