nefD/impact-tween — pull request #1 by audionerd (2012-08-28 18:59:26+00:00)
Title: fix for firefox 'invalid decrement operand' when minified with impactjs bake + jsmin

Firefox was reporting `SyntaxError: invalid decrement operand` at compile time due to the way this code appears when minified.

STORY TIME!

ImpactJS uses jsmin.php in its bake.php script, and jsmin.php in turn is based on douglas crockford's JSMin. Unless you use JSLint before JSMin, you won't catch a subtle little issue where a "confusing" series of operands will get a warning in JSLint, but find themselves happily minified by JSMin sans warning of any kind.

So, what you'd find would be:

Before JSMin:
`return Math.sqrt( 1 - --k * k );`

After JSMin:
`Math.sqrt(1---k*k);`

... and Firefox will take one look at `---` and go "Nope. Nope. Nope. NOT TODAY." (or equivalent).

SpiderMonkey does this at compile time, whereas JavaScriptCore will only do this at runtime (according to http://www.squarefree.com/2008/12/23/differences/)

If one were to run one's code through JSLint before using JSMin (as Mr. Crockford strongly admonishes) then one would protect oneself from issues like these. ImpactJS does not, however, use JSLint before JSMin.