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
join_vars folds an assignment into an object literal with a computed accessor key, skipping the setter #1709
join_object_assignments in lib/compress/tighten-body.js folds o.x = 1 into the
literal. Before doing so it checks that no existing property already defines x, but
the check is node.key.name != prop, and key.name is only meaningful for a
non-computed accessor, where key is an AST_SymbolMethod. With a computed key it
reads .name off whatever expression sits in the brackets — here the AST_SymbolRef k, whose name is "k" — so the collision is never seen. A static set x(v) is
handled correctly, which is why this only shows up with [k].
I have a patch that bails out unless every key is statically known (a string, or the AST_SymbolMethod of a non-computed accessor), so static accessors keep folding as
they do today. Full compress + mocha suites pass with it, plus the ufuzz run from CI.
Happy to send it as a PR if you want it.
Activity