You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c17742f
Browse filesBrowse the repository at this point in the historyBrowse files
fix(concatenate-modules): guard a module reference against ASI (#21962)
* fix(concatenate-modules): guard a module reference against ASI
A wrapped module's reference is emitted parenthesized, and the leading
semicolon that keeps it off the previous statement is only written when
the caller reports the position as unsafe. Both CommonJS call sites
claimed the position was always safe, so in semicolon-free source the
reference merged into the statement above it and threw at runtime.
Compute `asiSafe` from where the original call sits instead, and apply it
to the unused-export expression, which is parenthesized as well.
Closes#21955Closes#21956
* test(concatenate-modules): cover every ASI-sensitive module reference
The regression reached a release because no fixture under concatenation
was written without semicolons, so nothing executed a reference that ASI
could merge into the statement above it.
Cover the shapes that emit one: each re-export spelling, each require form
inside a wrapped body, and the three parenthesizing branches reached from
strict ESM. The last of those is a pin rather than a regression test -
those references already computed their position correctly.
0 commit comments