-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
I've noticed this when testing treeshakeability of a some library that this input code~:
const create = () => {
throw new Error('test')
}
/* #__PURE__ */ create({
foo: create({}),
});pretty much stays in the output, while when using Terser the outer call (the one annotated with PURE) gets eliminated. The inner call makes the difference here, because if we annotate it the whole thing just vanishes in both cases (as expected).
Expected Behavior
Matching behavior to Terser
Actual Behavior
Different behavior from Terser
Repro
Note from maintainer (@lukastaegert) :
The consensus on this issue is that even though the current behaviour is acceptable, it would be nice to replace call expressions with just their side-effectful arguments in certain cases. If someone wants to work towards a PR to improve this, see #3144 (comment) for implementation suggestions.
Reactions are currently unavailable