Index: runtime/lib/isolate_patch.dart |
diff --git a/runtime/lib/isolate_patch.dart b/runtime/lib/isolate_patch.dart |
index e82050fd0f075ee78be4174fe825de062b264d62..88312681963135c57b400bb62b60e6c3e6bc1fec 100644 |
--- a/runtime/lib/isolate_patch.dart |
+++ b/runtime/lib/isolate_patch.dart |
@@ -40,7 +40,10 @@ class _ReceivePortImpl extends Stream implements ReceivePort { |
{ Function onError, |
void onDone(), |
bool cancelOnError }) { |
- return _controller.stream.listen(onData); |
+ return _controller.stream.listen(onData, |
+ onError: onError, |
+ onDone: onDone, |
+ cancelOnError: cancelOnError); |
} |
close() { |
@@ -209,6 +212,15 @@ patch class Isolate { |
Uri uri, List<String> args, var message) { |
Completer completer = new Completer<Isolate>.sync(); |
try { |
+ if (args is List<String>) { |
+ for (int i = 0; i < args.length; i++) { |
+ if (args[i] is! String) { |
+ throw new ArgumentError("Args must be a list of Strings $args"); |
+ } |
+ } |
+ } else if (args != null) { |
+ throw new ArgumentError("Args must be a list of Strings $args"); |
Lasse Reichstein Nielsen
2013/10/25 14:28:24
If we allow null, will it be null at the other end
floitsch
2013/10/25 14:33:14
I would say `null`.
|
+ } |
// The VM will invoke [_startIsolate] and not `main`. |
SendPort controlPort = _spawnUri(uri.path); |
RawReceivePort readyPort = new RawReceivePort(); |