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

Unified Diff: runtime/lib/async_patch.dart

Issue 2684963004: Move _fatal to dart:async (Closed)
Patch Set: Restore the original behavior Created 3 years, 10 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
« no previous file with comments | « no previous file | runtime/lib/internal_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/async_patch.dart
diff --git a/runtime/lib/async_patch.dart b/runtime/lib/async_patch.dart
index d41a72153920d69aa01c6d82da212b620b193154..9e065da18c4c0790d6d370a1e9560d1f2711f594 100644
--- a/runtime/lib/async_patch.dart
+++ b/runtime/lib/async_patch.dart
@@ -4,6 +4,9 @@
import "dart:_internal";
+// Equivalent of calling FATAL from C++ code.
+_fatal(msg) native "DartAsync_fatal";
+
// We need to pass the value as first argument and leave the second and third
// arguments empty (used for error handling).
// See vm/ast_transformer.cc for usage.
@@ -97,8 +100,8 @@ class _AsyncStarStreamController {
// suspend;
// if (controller.isCancelled) return;
bool add(event) {
- if (!onListenReceived) fatal("yield before stream is listened to!");
- if (isSuspendedAtYield) fatal("unexpected yield");
+ if (!onListenReceived) _fatal("yield before stream is listened to");
+ if (isSuspendedAtYield) _fatal("unexpected yield");
// If stream is cancelled, tell caller to exit the async generator.
if (!controller.hasListener) {
return true;
@@ -115,7 +118,7 @@ class _AsyncStarStreamController {
// Returns true if the caller should terminate
// execution of the generator.
bool addStream(Stream stream) {
- if (!onListenReceived) fatal("yield before stream is listened to!");
+ if (!onListenReceived) _fatal("yield before stream is listened to");
// If stream is cancelled, tell caller to exit the async generator.
if (!controller.hasListener) return true;
isAdding = true;
« no previous file with comments | « no previous file | runtime/lib/internal_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698