#1740·terser

Missing parentheses around `yield*` used as a tagged-template tag changes runtime behavior

Author: colecrouterCreated Sep 16, 2026Updated Sep 16, 2026

Valid generator code returns true before minification and throws TypeError after minification. This reproduces with compression and mangling both disabled.

Before:

javascript
function* run(service) {
  return (yield* (yield* service)`x`).length > 0;
}

After:

javascript
function*run(n){return(yield*yield*n`x`).length>0}

Expected result

Preserve the grouping that makes the yielded value the tag, for example:

javascript
function*run(service){return(yield*(yield*service)`x`).length>0}

The output currently reparses with service itself as the tag instead of the inner yield* expression.