Skip to content
This repository has been archived by the owner on Aug 12, 2018. It is now read-only.

"short" is not a javascript keyword #219

Open
ghost opened this issue May 11, 2018 · 4 comments
Open

"short" is not a javascript keyword #219

ghost opened this issue May 11, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented May 11, 2018

seen here

notepad2-mod/src/Styles.c

Lines 616 to 622 in 30364fb

KEYWORDLIST KeyWords_JS = {
"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 let long native new null package private protected public "
"return short static super switch synchronized this throw throws transient true try typeof var "
"void volatile while with",
"", "", "", "", "", "", "", "" };

here is a sane list:

https://github.com/zufuliu/notepad2/blob/efe02fd4f532ba6159defcc1be54694d1ccdb68b/src/EditLexers/stlJavaScript.c#L8-L10

@rsvargas
Copy link

short was a future reserved word in EcmaScript version 3 and so were int, byte, char, goto, long, final, float, short, double, native, throws, boolean, abstract, volatile, transient, and synchronized. So it may be a good idea to mantain them...

(https://www-archive.mozilla.org/js/language/E262-3.pdf)

@ghost
Copy link
Author

ghost commented May 11, 2018

@rsvargas current EcmaScript doesnt define it, so it may be a bad idea to maintain it:

short
ReferenceError: short is not defined [Learn More]

@zufuliu
Copy link
Contributor

zufuliu commented May 11, 2018

Many of these reserved words are abandoned in ECMAScript 4 and above, they are just Java keywords or reserved words, and most modern browsers/clients supports at least ECMAScript 5 (2009), most developers write scripts target this version and above, that's why they are commented out in line 16:

// ECMAScript 1 till 3
//"abstract boolean byte char double final float goto int long native short synchronized throws transient volatile "

@ghost
Copy link
Author

ghost commented May 11, 2018

@zufuliu you should clarify that they are commented out with your version, not this one - cheers

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants