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' | 8 import 'dart:_isolate_helper' |
9 show CapabilityImpl, IsolateNatives, ReceivePortImpl, RawReceivePortImpl; | 9 show CapabilityImpl, IsolateNatives, ReceivePortImpl, RawReceivePortImpl; |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 } | 25 } |
26 | 26 |
27 @patch | 27 @patch |
28 static Future<Uri> get packageConfig { | 28 static Future<Uri> get packageConfig { |
29 throw new UnsupportedError("Isolate.packageConfig"); | 29 throw new UnsupportedError("Isolate.packageConfig"); |
30 } | 30 } |
31 | 31 |
32 static Uri _packageBase = Uri.base.resolve(IsolateNatives.packagesBase); | 32 static Uri _packageBase = Uri.base.resolve(IsolateNatives.packagesBase); |
33 | 33 |
34 @patch | 34 @patch |
35 static Future<Uri> resolvePackageUri(Uri packageUri) async { | 35 static Future<Uri> resolvePackageUri(Uri packageUri) { |
36 if (packageUri.scheme != 'package') return packageUri; | 36 if (packageUri.scheme != 'package') { |
37 return _packageBase.resolveUri(packageUri.replace(scheme: '')); | 37 return new Future<Uri>.value(packageUri); |
| 38 } |
| 39 return new Future<Uri>.value( |
| 40 _packageBase.resolveUri(packageUri.replace(scheme: ''))); |
38 } | 41 } |
39 | 42 |
40 @patch | 43 @patch |
41 static Future<Isolate> spawn(void entryPoint(message), var message, | 44 static Future<Isolate> spawn(void entryPoint(message), var message, |
42 {bool paused: false, | 45 {bool paused: false, |
43 bool errorsAreFatal, | 46 bool errorsAreFatal, |
44 SendPort onExit, | 47 SendPort onExit, |
45 SendPort onError}) { | 48 SendPort onError}) { |
46 bool forcePause = | 49 bool forcePause = |
47 (errorsAreFatal != null) || (onExit != null) || (onError != null); | 50 (errorsAreFatal != null) || (onExit != null) || (onError != null); |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 factory RawReceivePort([void handler(event)]) { | 236 factory RawReceivePort([void handler(event)]) { |
234 return new RawReceivePortImpl(handler); | 237 return new RawReceivePortImpl(handler); |
235 } | 238 } |
236 } | 239 } |
237 | 240 |
238 @patch | 241 @patch |
239 class Capability { | 242 class Capability { |
240 @patch | 243 @patch |
241 factory Capability() = CapabilityImpl; | 244 factory Capability() = CapabilityImpl; |
242 } | 245 } |
OLD | NEW |