Closed jabez128 closed 10 years ago
Why is it needed?
for example, if you have two self-invoking function:
a.js
(function(){ //do something a})()
b.js
(function(){//do something b})()
when you concatenate the two js files together, the result file will look like :
(function(){ //do something a})()(function(){//do something b})()
You have two statements without separator. This happens when you cat files together and then minify them.
so if you put a semicolon in the beginning, the result file will look like:
;(function(){ //do something a})();(function(){//do something b})()
it will be safe and sound, especially in large project.
Interesting... I should do the same modification to my other libraries. Thanks!
add a semicolon in the beigin for minifying