dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Removing newlines left by jsmin

  1. #1
    Join Date
    Jan 2006
    Location
    Palmer Alaska
    Posts
    132

    Post Removing newlines left by jsmin

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Palmer Alaska
    Posts
    132

    Red face

    Blush - have I stumped the chumps? And the experts?
    I foresee a project with which I can try this in the development stages without publicly "getting it all over ourselves". Problem is, I just can't test all the browsers out there...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles