I've downloaded the source for jsmin and built it on a OSX 10.7 box.
I first process my code with jslint (the Crockford app). I then process
with jsmin to creatify a compacted javascript file. jsmin does not remove newlines ('\n').
The reason, as I understand it, is because
the javascript interpreter automatically inserts semi-colons at line ends, if not found.
An example of such a problem can be found at
http://stackoverflow.com/questions/7...n-if-condition
However, jslint (which does not hurt my feelings) insists on semicolons at ends
of lines (so much as I can see, as I am just learning to use it).
It follows therefore, that if one first determines that the javascript source
file is given the okay from jslint, then it should be safe to remove newlines or replace them with spaces.
1)Am I correct?
2)Will removing newlines really speed up performance all that much?
Any and all constructive comments are welcomed.
thanks
tim


Reply With Quote

Bookmarks