Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keywords are highlighted even when preceded by . #3

Closed
TrevorBurnham opened this issue May 19, 2010 · 1 comment
Closed

Keywords are highlighted even when preceded by . #3

TrevorBurnham opened this issue May 19, 2010 · 1 comment

Comments

@TrevorBurnham
Copy link

Say the object obj has the property return. (Hey, I didn't choose it.) Then the line

obj.return = 1

compiles just fine, but the word return is highlighted like a keyword. Likewise for any other keyword. Obviously one could type obj['return'], but it would be nice to have accurate highlighting for the dot syntax.

@jashkenas
Copy link
Owner

I'm afraid you can't do that in all JavaScripts. Quoth the Webkit Inspector:

> obj = {};
Object
> obj.return = 1;
SyntaxError: Parse error

I think that having the "return" highlight as a keyword, letting you know you're making a mistake, is a very good thing to have. Closing the ticket.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants