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

Randori compiler needs a reserved word check for JS #136

Open
rolandzwaga opened this issue Jun 24, 2013 · 0 comments
Open

Randori compiler needs a reserved word check for JS #136

rolandzwaga opened this issue Jun 24, 2013 · 0 comments
Assignees

Comments

@rolandzwaga
Copy link
Member

Not all JS reserved words generate an error in Randori. Not even will some of these reserved words cause an error in a lot of browsers, but, the Google Closure compiler DOES choke on it. We need to keep Closure happy for obvious reasons, so here is a list of reserved words for JS, the compiler should throw an error when they are used in the wrong places:

abstract
boolean break byte
case catch char class const continue
debugger default delete do double
else enum export extends
false final finally float for function
goto
if implements import in instanceof int interface
long
native new null
package private protected public
return
short static super switch synchronized
this throw throws transient true try typeof
var volatile void
while with

Most of those words are not even used in the language. A reserved word cannot be used

As a name in literal object notation
As a member name in dot notation
As a function argument
As a var
As an unqualified global variable
As a statement label

I got this list and descriptions from this page by Douglas Crockford:
http://www.crockford.com/javascript/survey.html

@ghost ghost assigned teotigraphix Jun 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants