2 comments

[ 3.6 ms ] story [ 17.4 ms ] thread
This problem is very prevalent when concatenating JavaScript. The best defense is to prepend a semicolon before anonymous function closures.

For example, see Paul Irish's geo-location shim https://gist.github.com/366184