Hacker News new | ask | show | jobs
by palish 5171 days ago
Hey all,

Mr. Crockford has recently refused to fix JSMin (https://github.com/twitter/bootstrap/issues/3057).

Thus, I've fixed it. You can get the updated code from https://github.com/shawnpresser/JSMin/blob/master/jsmin.c

The fix was simple. It simply scans for "newline, optional whitespace, exclamation point" and replaces the newline with a semicolon.

I've given special attention to safety. This code works exactly as JSMin did, except it implements the aforementioned semicolon substitution, thus supporting the Javascript idiom:

  a()
  !b && c()
I hope this proves useful to someone (possibly the authors of Bootstrap). It was a fun project.
1 comments

I like the doing instead of all the talking. Kudos for this.