| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 if (readyPort != null) { | 302 if (readyPort != null) { |
| 303 readyPort.close(); | 303 readyPort.close(); |
| 304 } | 304 } |
| 305 return new Future<Isolate>.error(e, st); | 305 return new Future<Isolate>.error(e, st); |
| 306 } | 306 } |
| 307 } | 307 } |
| 308 | 308 |
| 309 /* patch */ static Future<Isolate> spawnUri( | 309 /* patch */ static Future<Isolate> spawnUri( |
| 310 Uri uri, List<String> args, var message, | 310 Uri uri, List<String> args, var message, |
| 311 {bool paused: false, | 311 {bool paused: false, |
| 312 SendPort onExit, |
| 313 SendPort onError, |
| 314 bool errorsAreFatal, |
| 312 bool checked, | 315 bool checked, |
| 316 Map<String, String> environment, |
| 313 Uri packageRoot, | 317 Uri packageRoot, |
| 314 Map<String, Uri> packages, | 318 Map<String, Uri> packages}) { |
| 315 bool errorsAreFatal, | |
| 316 SendPort onExit, | |
| 317 SendPort onError}) { | |
| 318 RawReceivePort readyPort; | 319 RawReceivePort readyPort; |
| 320 if (environment != null) throw new UnimplementedError("environment"); |
| 319 try { | 321 try { |
| 320 // The VM will invoke [_startIsolate] and not `main`. | 322 // The VM will invoke [_startIsolate] and not `main`. |
| 321 // TODO: Handle [packages]. | 323 // TODO: Handle [packages]. |
| 322 readyPort = new RawReceivePort(); | 324 readyPort = new RawReceivePort(); |
| 323 var packageRootString = | 325 var packageRootString = |
| 324 (packageRoot == null) ? null : packageRoot.toString(); | 326 (packageRoot == null) ? null : packageRoot.toString(); |
| 325 _spawnUri(readyPort.sendPort, uri.toString(), args, message, | 327 _spawnUri(readyPort.sendPort, uri.toString(), args, message, |
| 326 paused, checked, packageRootString, | 328 paused, checked, packageRootString, |
| 327 errorsAreFatal, onExit, onError); | 329 errorsAreFatal, onExit, onError); |
| 328 Completer completer = new Completer<Isolate>.sync(); | 330 Completer completer = new Completer<Isolate>.sync(); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 static Isolate _getCurrentIsolate() { | 459 static Isolate _getCurrentIsolate() { |
| 458 List portAndCapabilities = _getPortAndCapabilitiesOfCurrentIsolate(); | 460 List portAndCapabilities = _getPortAndCapabilitiesOfCurrentIsolate(); |
| 459 return new Isolate(portAndCapabilities[0], | 461 return new Isolate(portAndCapabilities[0], |
| 460 pauseCapability: portAndCapabilities[1], | 462 pauseCapability: portAndCapabilities[1], |
| 461 terminateCapability: portAndCapabilities[2]); | 463 terminateCapability: portAndCapabilities[2]); |
| 462 } | 464 } |
| 463 | 465 |
| 464 static List _getPortAndCapabilitiesOfCurrentIsolate() | 466 static List _getPortAndCapabilitiesOfCurrentIsolate() |
| 465 native "Isolate_getPortAndCapabilitiesOfCurrentIsolate"; | 467 native "Isolate_getPortAndCapabilitiesOfCurrentIsolate"; |
| 466 } | 468 } |
| OLD | NEW |