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
I understand why this can't be done by default, but it would be nice if there were a compress option to remove declarations that don't actually declare anything. This statement is generated by an upstream compiler (Civet 0.6.82, MWE), and in the context of the program I know that the iterator is pure and this statement is safe to drop.
The text was updated successfully, but these errors were encountered:
I never implemented this because it's not usually safe to do. If m is undefined, that's a TypeError. But of course, it's possible to do if we know it's iterable, or if the user passed some unsafe_xxx option signaling they're okay with being a bit loose with this.
Yeah -- as in the linked example code, this only ever happens in my code in a block guarded by Array.isArray(m), so I know it's safe in my case. And I totally understand if it needs to be locked behind an unsafe compress option.
Bug report or Feature request?
Feature request
Version (complete output of
terser -V
or specific git commit)5.27.2
Complete CLI command or
minify()
options usedterser
inputterser
output or errorExpected result
I understand why this can't be done by default, but it would be nice if there were a compress option to remove declarations that don't actually declare anything. This statement is generated by an upstream compiler (Civet 0.6.82, MWE), and in the context of the program I know that the iterator is pure and this statement is safe to drop.
The text was updated successfully, but these errors were encountered: