rspivak / slimit

SlimIt - a JavaScript minifier/parser in Python
MIT License
551 stars 94 forks source link

Slimit does not support the use of keywords as method names #52

Open shuhaowu opened 11 years ago

shuhaowu commented 11 years ago

If you are to use indexeddb, one of the instance method is continue.

This would cause a syntax error with slimit: SyntaxError: Unexpected token (CONTINUE, 'continue') at 1:6306 between LexToken(PERIOD,'.',1,6305) and LexToken(LPAREN,'(',1,6314)

Here are some sample codes:

>>> import slimit
>>> js = """
... var result = getCursor();
... result.continue();
... """
>>> slimit.minify(js) # This errors.
shuhaowu commented 11 years ago

Same thing with delete.

To get around this, use ["delete"] instead but that's not optimal.