Re:SimCity UI Code + DRM
by bdc on Tuesday March 12, 2013 @01:33AM
(#5360403)
On the subject of minification, I see a lot of lines that look like this[1]:
Why might that be a desired output from a minifier? Why not simply
[1] https://gist.github.com/anonymous/5133829#file-simcityui-js-...
[ Parent
| on HN ]
The original code could have been written as "condition ? true : false" and it's just not a pattern the minifier picks up on.
Probably a terrible mistake from the developer, not the minifier.
fireToken: f.tradeTokens.data.fireToken === 1 ? true : false
In my company I see JS code like the following: if (!!someFlag) { /* ... */ }