by palish · 14y ago · 0 comments
EDIT: Fixed. Thanks for pointing that out. Let me know if you find anything else.
cat foo.js; jsmin <foo.js
var foo = "foo",
is_foo = foo?
!!foo:
"bar";
var foo="foo",is_foo=foo?;!!foo:"bar";As of now, semicolon substitution isn't performed if the character before the newline is any of: & | + - * ? :
cat foo.js; jsmin <foo.js
foo = [
!"foo",
!"foo" %
!!"bar",
1 ==
!"foo"
];
foo=[;!"foo",;!"foo"%;!!"bar",1==;!"foo"];I'm searching for a fundamentally elegant solution. My current one is more of a kludge... though, if it fixes all cases and doesn't introduce problems, then maybe it's worth a few extra lines.