swc icon indicating copy to clipboard operation
swc copied to clipboard

feat(es/minifier): mark some builtin functions pure.

Open hyf0 opened this issue 2 years ago • 2 comments

Description:

          Can we have those list also in swc minifier? (itself)

Originally posted by @kdy1 in https://github.com/swc-project/swc/issues/6840#issuecomment-1398415208

BREAKING CHANGE:

Related issue (if exists):

The PR relies on code in #6840.

hyf0 avatar Jan 21 '23 13:01 hyf0

I think I misunderstand the usage of the esbuild's list.

Note that membership in this list says nothing about whether calling any of these functions has any side effects. It only says something about referencing these function without calling them (doesn't have side effects).

hyf0 avatar Jan 25 '23 04:01 hyf0

But still, there are indeed some expressions in the list that are calling without side effects. I need to tweak the list.

hyf0 avatar Jan 25 '23 04:01 hyf0