Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(825)

Unified Diff: runtime/lib/isolate_patch.dart

Issue 2414173003: Check for the type of the the spawned function. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/lib/isolate_patch.dart
diff --git a/runtime/lib/isolate_patch.dart b/runtime/lib/isolate_patch.dart
index 7e4579a419072dd90df43b52fa71e1f8f12141e0..65565058acf186d1c343b230bd69f03494fe7380 100644
--- a/runtime/lib/isolate_patch.dart
+++ b/runtime/lib/isolate_patch.dart
@@ -310,6 +310,11 @@ void _startIsolate(SendPort parentPort,
// `paused` isn't handled yet.
RawReceivePort readyPort;
try {
+ // Check for the type of `entryPoint` on the spawning isolate to make
+ // error-handling easier.
+ if (entryPoint is! _MainFunctionArgs) {
Lasse Reichstein Nielsen 2016/10/14 10:13:56 _MainFunctionArgs is not really the correct type n
floitsch 2016/10/14 11:25:58 Done.
+ throw new ArgumentError(entryPoint);
+ }
// The VM will invoke [_startIsolate] with entryPoint as argument.
readyPort = new RawReceivePort();

Powered by Google App Engine
This is Rietveld 408576698