Commit 87f64561 authored by Erik Luo's avatar Erik Luo Committed by Commit Bot

DevTools: update autocomplete keywords to ES2017

This updates the JS autocomplete keyword list with keywords from
Section 11.6.2.1
https://www.ecma-international.org/ecma-262/8.0/index.html

Screenshot: https://imgur.com/a/sX1wOP7

Bug: none
Change-Id: Ia555723e35311a83d6e64f19fc253a3ea9368384
Reviewed-on: https://chromium-review.googlesource.com/1058562Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558840}
parent 470798de
......@@ -506,12 +506,20 @@ ObjectUI.JavaScriptAutocomplete = class {
const quoteUsed = (bracketNotation && query.startsWith('\'')) ? '\'' : '"';
if (!expressionString) {
// See ES2017 spec: https://www.ecma-international.org/ecma-262/8.0/index.html
const keywords = [
'break', 'case', 'catch', 'continue', 'default', 'delete', 'do', 'else', 'finally',
'for', 'function', 'if', 'in', 'instanceof', 'new', 'return', 'switch', 'this',
'throw', 'try', 'typeof', 'var', 'void', 'while', 'with'
// Section 11.6.2.1 Reserved keywords.
'await', 'break', 'case', 'catch', 'class', 'const', 'continue', 'debugger', 'default', 'delete', 'do', 'else',
'exports', 'extends', 'finally', 'for', 'function', 'if', 'import', 'in', 'instanceof', 'new', 'return',
'super', 'switch', 'this', 'throw', 'try', 'typeof', 'var', 'void', 'while', 'with', 'yield',
// Section 11.6.2.1's note mentions words treated as reserved in certain cases.
'let', 'static',
// Other keywords not explicitly reserved by spec.
'async', 'of'
];
propertyGroups.push({title: Common.UIString('keywords'), items: keywords});
propertyGroups.push({title: ls`keywords`, items: keywords.sort()});
}
/** @type {!Set<string>} */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment