Bug 1901411 - Part 2: Fix sanity check for debugger. r=mgaudet, a=dmeehan

Differential Revision: https://phabricator.services.mozilla.com/D213352
This commit is contained in:
Tooru Fujisawa 2024-06-19 16:31:26 +00:00
parent 670e059b72
commit 4b94191090

View File

@ -801,8 +801,7 @@ class MOZ_STACK_CLASS MaybeEnterAsyncGeneratorRealm {
[[nodiscard]] static bool AsyncGeneratorMethodSanityCheck(
JSContext* cx, Handle<AsyncGeneratorObject*> generator) {
if (generator->isCompleted() || generator->isSuspendedStart() ||
generator->isSuspendedYield()) {
if (generator->isSuspendedStart() || generator->isSuspendedYield()) {
// The spec assumes the queue is empty when async generator methods are
// called with those state, but our debugger allows calling those methods
// in unexpected state, such as before suspendedStart.