TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

23 pointsby palishabout 13 years ago

3 comments

palishabout 13 years ago
Hey all,<p>Mr. Crockford has recently refused to fix JSMin (<a href="https://github.com/twitter/bootstrap/issues/3057" rel="nofollow">https://github.com/twitter/bootstrap/issues/3057</a>).<p>Thus, I've fixed it. You can get the updated code from <a href="https://github.com/shawnpresser/JSMin/blob/master/jsmin.c" rel="nofollow">https://github.com/shawnpresser/JSMin/blob/master/jsmin.c</a><p>The fix was simple. It simply scans for "newline, optional whitespace, exclamation point" and replaces the newline with a semicolon.<p>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:<p><pre><code> a() !b &#38;&#38; c() </code></pre> I hope this proves useful to someone (possibly the authors of Bootstrap). It was a fun project.
评论 #3843366 未加载
MrEnigmaabout 13 years ago
Well that discussion is pretty crazy and very polarized.<p>JSMin guy thinks fixing it is stupid, and the bootstrap guy says that since it works in browsers it should work in JSMin.<p>So they've reached an impasse. Unfortunately emotions and strong words were used right away which polarizes the conversation.<p>Being completely pragmatic about it, it seems that bootstrap should probably change, instead of JSMin. But I don't think either will so both sides lose, and potentially make their tools available to a smaller audience.
tszmingabout 13 years ago
Please send a pull request to Crockford :)