Based on ES6 keywords: [msn docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_gr...) and [ES6 specification](http://www.ecma-international.org/ecma-262/6.0/#sec-keywords).
I did a second 'amend' commit to remove `each` from primary since I didn't find anywhere it's keyworded. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1361
-- Commit Summary --
* Updated js keywords with ES6 * Some adjustmenys in javascript keywords: Deleted 'each' from secondary keywords
-- File Changes --
M data/filedefs/filetypes.javascript (4)
-- Patch Links --
https://github.com/geany/geany/pull/1361.patch https://github.com/geany/geany/pull/1361.diff
b4n requested changes on this pull request.
@@ -3,8 +3,8 @@
[keywords] # all items must be in one line -primary=break case catch class const continue default delete do each else extends false finally for function get if in Infinity instanceof let NaN new null return set static super switch this throw true try typeof undefined var void while with yield prototype -secondary=Array Boolean Date Function Math Number Object String RegExp EvalError Error RangeError ReferenceError SyntaxError TypeError URIError constructor prototype decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt +primary=break case catch class const continue debugger default delete do else enum export extends false finally for function get if import in Infinity instanceof let NaN new null return set static super switch this throw true try typeof undefined var void while with yield prototype async await
I can't see `async` as a keyword in either references
@@ -3,8 +3,8 @@
[keywords] # all items must be in one line -primary=break case catch class const continue default delete do each else extends false finally for function get if in Infinity instanceof let NaN new null return set static super switch this throw true try typeof undefined var void while with yield prototype -secondary=Array Boolean Date Function Math Number Object String RegExp EvalError Error RangeError ReferenceError SyntaxError TypeError URIError constructor prototype decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt +primary=break case catch class const continue debugger default delete do else enum export extends false finally for function get if import in Infinity instanceof let NaN new null return set static super switch this throw true try typeof undefined var void while with yield prototype async await +secondary=Array Boolean Date Function Math Number Object String RegExp EvalError Error RangeError ReferenceError SyntaxError TypeError URIError constructor prototype decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt alert
Adding `alert` is somewhat questionable, especially as I'm not really sure it's available outside browsers. I don't know with Node, but GJS doesn't have it. And according to https://developer.mozilla.org/en-US/docs/Web/API/Window/alert it seems to be a DOM thing, not a plain JS one.
Akronix commented on this pull request.
@@ -3,8 +3,8 @@
[keywords] # all items must be in one line -primary=break case catch class const continue default delete do each else extends false finally for function get if in Infinity instanceof let NaN new null return set static super switch this throw true try typeof undefined var void while with yield prototype -secondary=Array Boolean Date Function Math Number Object String RegExp EvalError Error RangeError ReferenceError SyntaxError TypeError URIError constructor prototype decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt +primary=break case catch class const continue debugger default delete do else enum export extends false finally for function get if import in Infinity instanceof let NaN new null return set static super switch this throw true try typeof undefined var void while with yield prototype async await
It's because async/await expressions [are in the draft for ES2017](https://tc39.github.io/ecmascript-asyncawait/#async-function-definitions) but [await expressions have to be inside an async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements...). Many browsers already support it: Chrome, Firefox and Opera, and Babel compile it to legacy code for other platforms; so people can already program using async/await of ES7, and people actually do. I've checked that other tools highlight the word: Atom, Chrome Dev Tools,...
Akronix commented on this pull request.
@@ -3,8 +3,8 @@
[keywords] # all items must be in one line -primary=break case catch class const continue default delete do each else extends false finally for function get if in Infinity instanceof let NaN new null return set static super switch this throw true try typeof undefined var void while with yield prototype -secondary=Array Boolean Date Function Math Number Object String RegExp EvalError Error RangeError ReferenceError SyntaxError TypeError URIError constructor prototype decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt +primary=break case catch class const continue debugger default delete do else enum export extends false finally for function get if import in Infinity instanceof let NaN new null return set static super switch this throw true try typeof undefined var void while with yield prototype async await +secondary=Array Boolean Date Function Math Number Object String RegExp EvalError Error RangeError ReferenceError SyntaxError TypeError URIError constructor prototype decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt alert
Yes, `alert` doesn't work on node. If you're restricting the parser to strict plain JavaScript, then yes, it should not be added.
b4n commented on this pull request.
@@ -3,8 +3,8 @@
[keywords] # all items must be in one line -primary=break case catch class const continue default delete do each else extends false finally for function get if in Infinity instanceof let NaN new null return set static super switch this throw true try typeof undefined var void while with yield prototype -secondary=Array Boolean Date Function Math Number Object String RegExp EvalError Error RangeError ReferenceError SyntaxError TypeError URIError constructor prototype decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt +primary=break case catch class const continue debugger default delete do else enum export extends false finally for function get if import in Infinity instanceof let NaN new null return set static super switch this throw true try typeof undefined var void while with yield prototype async await +secondary=Array Boolean Date Function Math Number Object String RegExp EvalError Error RangeError ReferenceError SyntaxError TypeError URIError constructor prototype decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt alert
And if you don't, you probably should add `prompt` and friends. IMO we should leave `alert` out.
b4n commented on this pull request.
@@ -3,8 +3,8 @@
[keywords] # all items must be in one line -primary=break case catch class const continue default delete do each else extends false finally for function get if in Infinity instanceof let NaN new null return set static super switch this throw true try typeof undefined var void while with yield prototype -secondary=Array Boolean Date Function Math Number Object String RegExp EvalError Error RangeError ReferenceError SyntaxError TypeError URIError constructor prototype decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt +primary=break case catch class const continue debugger default delete do else enum export extends false finally for function get if import in Infinity instanceof let NaN new null return set static super switch this throw true try typeof undefined var void while with yield prototype async await
OK then
@Akronix pushed 1 commit.
c698469 Removed 'alert' from secondary keywords since it depends on a DOM environment
Akronix commented on this pull request.
@@ -3,8 +3,8 @@
[keywords] # all items must be in one line -primary=break case catch class const continue default delete do each else extends false finally for function get if in Infinity instanceof let NaN new null return set static super switch this throw true try typeof undefined var void while with yield prototype -secondary=Array Boolean Date Function Math Number Object String RegExp EvalError Error RangeError ReferenceError SyntaxError TypeError URIError constructor prototype decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt +primary=break case catch class const continue debugger default delete do else enum export extends false finally for function get if import in Infinity instanceof let NaN new null return set static super switch this throw true try typeof undefined var void while with yield prototype async await +secondary=Array Boolean Date Function Math Number Object String RegExp EvalError Error RangeError ReferenceError SyntaxError TypeError URIError constructor prototype decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt alert
I agree. Fixed in latest commit.
ping
Merged #1361.
Merged, thank you
github-comments@lists.geany.org