slimit
slimit copied to clipboard
Conflict with underscore
I recently used this in a case where the minifier called a local function "_". Since I'm using underscore later, it breaks because it's going to the local function, where the original code ran fine. Is there any way to set a no-set-list for cases like this? Thanks :)
Looks like the solution for underscore-using scripts is:
slimit.scope.ID_CHARS='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$'
without the _ in that string. It won't rename anything to underscore. Really it could possibly be overwriting any global variable, but there is little chance of there being one with one or two-character variables slimit usually creates.
Currently there is no command line option to specify ID characters, but as @programmin1 mentioned you can do that in the Slimit's source code explicitly as a workaround.
Why does it need to be changed in the source code? In my tests setting
import slimit slimit.scope.ID_CHARS='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$'
before using slimit module fixes the problem. Unless there is a problem I'm not considering?