Files
sdk/pkg/js_runtime/lib/synced/async_status_codes.dart
T
Stephen Adams 2a66f966f3 [dart2js] Rename dart:_async_await_error_codes -> dart:_async_status_codes
Change-Id: I6b47f08791544eabc09bb05a81bbd0154bc39cb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296704
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-04-21 00:01:51 +00:00

31 lines
1.1 KiB
Dart

// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// ignore_for_file: constant_identifier_names
/// Codes that transformed sync*/async/async* functions use to communicate with
/// js_helper functions.
const int SUCCESS = 0;
const int ERROR = 1;
const int STREAM_WAS_CANCELED = 2;
// A sync* function transformed 'body' returns the following codes to
// communicate the updated state of the `_SyncStarIterator` (Iterator).
/// The sync* body has terminated. The body should not be called again.
const int SYNC_STAR_DONE = 0;
/// The sync* body has updated the `_current` field of the Iterator with the
/// value that is yielded.
const int SYNC_STAR_YIELD = 1;
/// The sync* body has updated the Iterator with an Iterable. The elements of
/// the Iterable are the next values of the Iterator.
const int SYNC_STAR_YIELD_STAR = 2;
/// The sync* body throws an exception. The exception has been stored on a field
/// of the Iterator.
const int SYNC_STAR_UNCAUGHT_EXCEPTION = 3;