Chromium Code Reviews| Index: sdk/lib/_internal/js_runtime/lib/isolate_patch.dart |
| diff --git a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart |
| index 79931ba3039fc1ecb99f22516e6c19d3cb74bccf..d8482b9f87f755b5147f3ae21672dcb4e0fc26a3 100644 |
| --- a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart |
| +++ b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart |
| @@ -10,6 +10,8 @@ import 'dart:_isolate_helper' show CapabilityImpl, |
| ReceivePortImpl, |
| RawReceivePortImpl; |
| +typedef _SingleArgumentFunction(arg); |
|
Lasse Reichstein Nielsen
2016/10/14 10:13:56
Just _UnaryFunction.
floitsch
2016/10/14 11:25:42
Done.
|
| + |
| @patch |
| class Isolate { |
| static final _currentIsolateCache = IsolateNatives.currentIsolate; |
| @@ -42,6 +44,11 @@ class Isolate { |
| (onExit != null) || |
| (onError != null); |
| try { |
| + // Check for the type of `entryPoint` on the spawning isolate to make |
| + // error-handling easier. |
| + if (entryPoint is! _SingleArgumentFunction) { |
| + throw new ArgumentError(entryPoint); |
| + } |
| // TODO: Consider passing the errorsAreFatal/onExit/onError values |
| // as arguments to the internal spawnUri instead of setting |
| // them after the isolate has been created. |