subtleGradient/language-javascript-jsx

undefined not getting class attributes

cannoneyed opened this issue · 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

This is pretty frustrating— any tips to correct this?

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 ^_^

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

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!