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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 | 324 |
325 /* patch */ static Future<Isolate> spawnUri( | 325 /* patch */ static Future<Isolate> spawnUri( |
326 Uri uri, List<String> args, var message, | 326 Uri uri, List<String> args, var message, |
327 {bool paused: false, | 327 {bool paused: false, |
328 SendPort onExit, | 328 SendPort onExit, |
329 SendPort onError, | 329 SendPort onError, |
330 bool errorsAreFatal, | 330 bool errorsAreFatal, |
331 bool checked, | 331 bool checked, |
332 Map<String, String> environment, | 332 Map<String, String> environment, |
333 Uri packageRoot, | 333 Uri packageRoot, |
334 Map<String, Uri> packages}) { | 334 Map<String, Uri> packageMap}) { |
335 RawReceivePort readyPort; | 335 RawReceivePort readyPort; |
336 if (environment != null) throw new UnimplementedError("environment"); | 336 if (environment != null) throw new UnimplementedError("environment"); |
337 if (packages != null) throw new UnimplementedError("packages"); | 337 if (packageMap != null) throw new UnimplementedError("packageMap"); |
338 try { | 338 try { |
339 // The VM will invoke [_startIsolate] and not `main`. | 339 // The VM will invoke [_startIsolate] and not `main`. |
340 // TODO: Handle [packages]. | 340 // TODO: Handle [packagesMap]. |
341 readyPort = new RawReceivePort(); | 341 readyPort = new RawReceivePort(); |
342 var packageRootString = | 342 var packageRootString = |
343 (packageRoot == null) ? null : packageRoot.toString(); | 343 (packageRoot == null) ? null : packageRoot.toString(); |
344 var packagesList = null; | 344 var packagesList = null; |
345 | 345 |
346 _spawnUri(readyPort.sendPort, uri.toString(), | 346 _spawnUri(readyPort.sendPort, uri.toString(), |
347 args, message, | 347 args, message, |
348 paused, onExit, onError, | 348 paused, onExit, onError, |
349 errorsAreFatal, checked, | 349 errorsAreFatal, checked, |
350 null, /* environment */ | 350 null, /* environment */ |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 static Isolate _getCurrentIsolate() { | 483 static Isolate _getCurrentIsolate() { |
484 List portAndCapabilities = _getPortAndCapabilitiesOfCurrentIsolate(); | 484 List portAndCapabilities = _getPortAndCapabilitiesOfCurrentIsolate(); |
485 return new Isolate(portAndCapabilities[0], | 485 return new Isolate(portAndCapabilities[0], |
486 pauseCapability: portAndCapabilities[1], | 486 pauseCapability: portAndCapabilities[1], |
487 terminateCapability: portAndCapabilities[2]); | 487 terminateCapability: portAndCapabilities[2]); |
488 } | 488 } |
489 | 489 |
490 static List _getPortAndCapabilitiesOfCurrentIsolate() | 490 static List _getPortAndCapabilitiesOfCurrentIsolate() |
491 native "Isolate_getPortAndCapabilitiesOfCurrentIsolate"; | 491 native "Isolate_getPortAndCapabilitiesOfCurrentIsolate"; |
492 } | 492 } |
OLD | NEW |