| 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 // Patch file for the dart:isolate library. | 5 // Patch file for the dart:isolate library. |
| 6 | 6 |
| 7 import 'dart:_js_helper' show patch; | 7 import 'dart:_js_helper' show patch; |
| 8 import 'dart:_isolate_helper' show CapabilityImpl, | 8 import 'dart:_isolate_helper' show CapabilityImpl, |
| 9 CloseToken, | 9 CloseToken, |
| 10 IsolateNatives, | 10 IsolateNatives, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 return new Future<Isolate>.error(e, st); | 33 return new Future<Isolate>.error(e, st); |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 | 36 |
| 37 @patch | 37 @patch |
| 38 static Future<Isolate> spawnUri( | 38 static Future<Isolate> spawnUri( |
| 39 Uri uri, List<String> args, var message, { bool paused: false, | 39 Uri uri, List<String> args, var message, { bool paused: false, |
| 40 Uri packageRoot }) { | 40 Uri packageRoot }) { |
| 41 if (packageRoot != null) throw new UnimplementedError("packageRoot"); | 41 if (packageRoot != null) throw new UnimplementedError("packageRoot"); |
| 42 try { | 42 try { |
| 43 if (args is List<String>) { | 43 if (args is List) { |
| 44 for (int i = 0; i < args.length; i++) { | 44 for (int i = 0; i < args.length; i++) { |
| 45 if (args[i] is! String) { | 45 if (args[i] is! String) { |
| 46 throw new ArgumentError("Args must be a list of Strings $args"); | 46 throw new ArgumentError("Args must be a list of Strings $args"); |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 } else if (args != null) { | 49 } else if (args != null) { |
| 50 throw new ArgumentError("Args must be a list of Strings $args"); | 50 throw new ArgumentError("Args must be a list of Strings $args"); |
| 51 } | 51 } |
| 52 return IsolateNatives.spawnUri(uri, args, message, paused) | 52 return IsolateNatives.spawnUri(uri, args, message, paused) |
| 53 .then((msg) => new Isolate(msg[1], | 53 .then((msg) => new Isolate(msg[1], |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 factory RawReceivePort([void handler(event)]) { | 151 factory RawReceivePort([void handler(event)]) { |
| 152 return new RawReceivePortImpl(handler); | 152 return new RawReceivePortImpl(handler); |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 | 155 |
| 156 @patch | 156 @patch |
| 157 class Capability { | 157 class Capability { |
| 158 @patch | 158 @patch |
| 159 factory Capability() = CapabilityImpl; | 159 factory Capability() = CapabilityImpl; |
| 160 } | 160 } |
| OLD | NEW |