OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import "dart:collection" show HashMap; | 5 import "dart:collection" show HashMap; |
6 import "dart:_internal"; | 6 import "dart:_internal"; |
7 | 7 |
8 patch class ReceivePort { | 8 patch class ReceivePort { |
9 /* patch */ factory ReceivePort() = _ReceivePortImpl; | 9 /* patch */ factory ReceivePort() = _ReceivePortImpl; |
10 | 10 |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 // Inherit this isolate's package resolution setup if not overridden. | 371 // Inherit this isolate's package resolution setup if not overridden. |
372 if (!automaticPackageResolution && | 372 if (!automaticPackageResolution && |
373 (packageRoot == null) && | 373 (packageRoot == null) && |
374 (packageConfig == null)) { | 374 (packageConfig == null)) { |
375 if (Isolate._packageSupported()) { | 375 if (Isolate._packageSupported()) { |
376 packageRoot = await Isolate.packageRoot; | 376 packageRoot = await Isolate.packageRoot; |
377 packageConfig = await Isolate.packageConfig; | 377 packageConfig = await Isolate.packageConfig; |
378 } | 378 } |
379 } | 379 } |
380 | 380 |
| 381 // Ensure to resolve package: URIs being handed in as parameters. |
| 382 packageRoot = (packageRoot == null) ? null : |
| 383 await Isolate.resolvePackageUri(packageRoot); |
| 384 packageConfig = (packageConfig == null) ? null : |
| 385 await Isolate.resolvePackageUri(packageConfig); |
| 386 |
381 // The VM will invoke [_startIsolate] and not `main`. | 387 // The VM will invoke [_startIsolate] and not `main`. |
382 readyPort = new RawReceivePort(); | 388 readyPort = new RawReceivePort(); |
383 var packageRootString = packageRoot?.toString(); | 389 var packageRootString = packageRoot?.toString(); |
384 var packageConfigString = packageConfig?.toString(); | 390 var packageConfigString = packageConfig?.toString(); |
385 | 391 |
386 _spawnUri(readyPort.sendPort, spawnedUri.toString(), | 392 _spawnUri(readyPort.sendPort, spawnedUri.toString(), |
387 args, message, | 393 args, message, |
388 paused, onExit, onError, | 394 paused, onExit, onError, |
389 errorsAreFatal, checked, | 395 errorsAreFatal, checked, |
390 null, /* environment */ | 396 null, /* environment */ |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 try { | 553 try { |
548 return Uri.parse(_getCurrentRootUriStr()); | 554 return Uri.parse(_getCurrentRootUriStr()); |
549 } catch (e, s) { | 555 } catch (e, s) { |
550 return null; | 556 return null; |
551 } | 557 } |
552 } | 558 } |
553 | 559 |
554 static String _getCurrentRootUriStr() | 560 static String _getCurrentRootUriStr() |
555 native "Isolate_getCurrentRootUriStr"; | 561 native "Isolate_getCurrentRootUriStr"; |
556 } | 562 } |
OLD | NEW |