Skip to content

Commit 30942cf

Browse files
committed
.
1 parent 828d9e4 commit 30942cf

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

continue.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
- Async functions now resolve their completion through the global Promise constructor even when executed from nested scopes (class/field environments fall back to the root global object), so the async class element clusters involving same-line static async methods/private names are green again.
3232
- Parameter environments now hang off their function environments so default-parameter `super`/`this` lookups see the right bindings, and sloppy generator methods coerce `this` to the realm global object; the object method definition default-super/sloppy-this generators are passing.
3333
- Named generator function expressions now skip the internal const name binding when a function-name environment already exists, so sloppy reassignments of the generator name are ignored instead of throwing (covers the generator `reassign-fn-name` and `scope-name-var-open` tests).
34+
- `yield*` now treats a delegated iterator's `throw` result with `done: true` as a normal completion, propagating the returned `value` and finalizing delegation instead of yielding again (fixes the `star-rhs-iter-thrw-res-*` throw/done cases).
3435

3536
## Next Iteration Plan
3637
1. When resuming broader work, run a narrow Language filter outside `ArgumentsObject`/`Array_fromAsync` to find the next hot cluster (avoid full 43k sweep).

src/Asynkron.JsEngine/Ast/TypedAstEvaluator.TypedGeneratorInstance.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,22 @@ private static bool TryGetSymbolValue(JsEnvironment environment, Symbol symbol,
757757
return CompleteReturn(abruptValue);
758758
}
759759

760+
// If the delegated iterator's throw method completed (done=true),
761+
// the yield* expression completes normally with that value (no further delegation).
762+
if (propagateThrow && iteratorResult.Done)
763+
{
764+
yieldStarState.State = null;
765+
yieldStarState.AwaitingResume = false;
766+
environment.Assign(yieldStarInstruction.StateSlotSymbol, null);
767+
if (yieldStarInstruction.ResultSlotSymbol is { } throwResultSlot)
768+
{
769+
StoreSymbolValue(environment, throwResultSlot, iteratorResult.Value);
770+
}
771+
772+
_programCounter = yieldStarInstruction.Next;
773+
break;
774+
}
775+
760776
if (iteratorResult.Done && !propagateThrow && !propagateReturn)
761777
{
762778
yieldStarState.State = null;

0 commit comments

Comments
 (0)