Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow use of ES3 future reserved words in dot notation (regardless of option.es5) #674
In the code I'm currently pluggin in it makes use of a prototype method called
I ran tests for this against a whole bunch of browsers and they all worked fine:
TestSwarm report: http://integration.wmflabs.org/testswarm/job/1
QUnit test runner: http://toolserver.org/~krinkle/tmp/test-js/?module=Prop%20static
And what engines will do in the future doesn't realy matter since from ES5 onwards using them in dot notation is allowed either way.
i don't think it's called out explicitly somewhere in a way like "property names may be reserved words".
from http://es5.github.com/#x7.6 you can see what is allowed for an IdentifierName
...and then from http://es5.github.com/#x11.1.5
you can see that a PropertyName can be an IdentifierName.
putting all this together, property names can be reserved words.
right... but -
Well.. reserved words are always allowed in dot notation in ES5. No doubt there :) JSHint explicitly doesn't warn for it with
The point here is about ES3. We know in ES3 reserved words were not allowed in dot notation. So something like
So, pre-ES5 browsers don't seem to consider Future Reserved Words illegal in dot notation, only actual Reserved Words. Meaning, we don't have to emit an error when validating under ES3 when using Future Reserved Words in dot notation. Many people don't even know about Future Reserved Words (and as such just use them), and there was no reason to believe otherwise as apparently browsers didn't care either.