language-javascript-jsx icon indicating copy to clipboard operation
language-javascript-jsx copied to clipboard

undefined not getting class attributes

Open cannoneyed opened this issue 10 years ago • 4 comments

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

cannoneyed avatar Aug 25 '15 19:08 cannoneyed

This is pretty frustrating— any tips to correct this?

dsernst avatar Sep 10 '15 18:09 dsernst

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 avatar Sep 19 '15 21:09 subtleGradient

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

subtleGradient avatar Sep 19 '15 21:09 subtleGradient

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!

cannoneyed avatar Sep 19 '15 21:09 cannoneyed