Skip to content

Comment on Show HN: JSMin fork (allows Bootstrap's idiom)

Comments

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.

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

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.