| 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:_isolate_helper' show IsolateNatives, | 7 import 'dart:_isolate_helper' show IsolateNatives, |
| 8 lazyPort, | 8 lazyPort, |
| 9 ReceivePortImpl; | 9 ReceivePortImpl; |
| 10 | 10 |
| 11 patch class _Isolate { | 11 patch class _Isolate { |
| 12 patch static ReceivePort get port { | 12 patch static ReceivePort get port { |
| 13 if (lazyPort == null) { | 13 if (lazyPort == null) { |
| 14 lazyPort = new ReceivePort(); | 14 lazyPort = new ReceivePort(); |
| 15 } | 15 } |
| 16 return lazyPort; | 16 return lazyPort; |
| 17 } | 17 } |
| 18 | 18 |
| 19 patch static SendPort spawnFunction(void topLevelFunction(), | 19 patch static SendPort spawnFunction(void topLevelFunction(), |
| 20 [bool UnhandledExceptionCallback(IsolateUnhandledException e)]) { | 20 [bool unhandledExceptionCallback(IsolateUnhandledException e)]) { |
| 21 // TODO(9012): Don't ignore the UnhandledExceptionCallback. | 21 if (unhandledExceptionCallback != null) { |
| 22 // TODO(9012): Implement the UnhandledExceptionCallback. |
| 23 throw new UnimplementedError( |
| 24 "spawnFunction with unhandledExceptionCallback"); |
| 25 } |
| 22 return IsolateNatives.spawnFunction(topLevelFunction); | 26 return IsolateNatives.spawnFunction(topLevelFunction); |
| 23 } | 27 } |
| 24 | 28 |
| 25 patch static SendPort spawnUri(String uri) { | 29 patch static SendPort spawnUri(String uri) { |
| 26 return IsolateNatives.spawn(null, uri, false); | 30 return IsolateNatives.spawn(null, uri, false); |
| 27 } | 31 } |
| 28 } | 32 } |
| 29 | 33 |
| 30 /** Default factory for receive ports. */ | 34 /** Default factory for receive ports. */ |
| 31 patch class ReceivePort { | 35 patch class ReceivePort { |
| 32 patch factory ReceivePort() { | 36 patch factory ReceivePort() { |
| 33 return new ReceivePortImpl(); | 37 return new ReceivePortImpl(); |
| 34 } | 38 } |
| 35 } | 39 } |
| OLD | NEW |