subtleGradient / language-javascript-jsx

JavaScript with JSX Bundle for Atom
45 stars 6 forks source link

undefined not getting class attributes #8

Open cannoneyed opened 9 years ago

cannoneyed commented 9 years ago

undefined is the only keyword not properly labeled with a class name...

This regex just doesn't seem to bbe able to match the word undefined https://github.com/subtleGradient/language-javascript-jsx/blob/master/grammars/javascript.cson#L742-L745

dsernst commented 9 years ago

This is pretty frustrating— any tips to correct this?

subtleGradient commented 8 years ago

undefined is a variable, not a keyword

You can even define it if you want to introduce some really horrible bugs to third party code.

var undefined = {lulz:true}
typeof undefined === 'object'

Isn't JavaScript a fun language ^_^

subtleGradient commented 8 years ago

That being said, I agree that it shouldn't be scoped just like any other variable. I'll make it a support.whatever variable since it's mostly special in practice, even though it's not technically special

cannoneyed commented 8 years ago

Oh god you're right...

But in practice it definitely is nice to see it highlighted as if it were a literal ala null. That's how a lot of grammars do it and it just seems right.

Thanks for checking this out!