top | item 3843490

(no title)

palish | 14 years ago

The "prior character blacklist" is now:

  & | + - * ? : % = ( [ { ,
Currently hunting for more problems, and a more elegant solution...

Offtopic, the reason I did this JSMin fork was just to challenge myself, not to make a political statement or anything like that. My cat was just diagnosed with feline lukemia. I know this project is a little silly, but it's been fantastic for keeping my mind off of real-world stuff. You're awesome for providing all of these examples; thank you.

More usefully, this serves to prove that Mr. Crockford was likely correct in his assessment.

discuss

order

thezilch|14 years ago

Also, consider non-punctuator issues; such as those with exposed reserved-keywords.

  cat foo.js; jsmin <foo.js
  do
    !!1 && 2
  while(0)

  do;!!1&&2
  while(0)

palish|14 years ago

Heh heh. You may have just found a fatal flaw.

On the other hand, is "do" the only reserved keyword which matters? Then it might be okay to special case that one instance as well.

There is no doubt that my approach is the wrong approach; I'm just curious whether it's easier to handle each of the ~dozen special cases than to fundamentally rewrite JSMin (as a full ECMAScript parser).

EDIT: Amusingly, I've special-cased the 'do' keyword in a fairly straightforward way, so now the code handles every example thus far. I wonder if these are the only special cases required, and whether they add any adverse side-effects. Also, you're extremely talented and creative.