Web Inspector: Include `globalThis` in default JavaScript completions
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2019 20:29:24 +0000 (20:29 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2019 20:29:24 +0000 (20:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193147

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-04
Reviewed by Devin Rousso.

* UserInterface/Controllers/CodeMirrorCompletionController.js:
Add `globalThis` which is a new global value.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239630 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js

index af7fc15..55d4eff 100644 (file)
@@ -1,3 +1,13 @@
+2019-01-04  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Include `globalThis` in default JavaScript completions
+        https://bugs.webkit.org/show_bug.cgi?id=193147
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Controllers/CodeMirrorCompletionController.js:
+        Add `globalThis` which is a new global value.
+
 2019-01-03  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: conic-gradient color picker doesn't accurately show color when saturation value is not 100%
index 62dc9a8..7774f1c 100644 (file)
@@ -661,7 +661,7 @@ WI.CodeMirrorCompletionController = class CodeMirrorCompletionController extends
             "return", "static", "super", "switch", "this", "throw", "true", "try",
             "typeof", "undefined", "var", "void", "while", "with", "yield"
         ];
-        var valueKeywords = ["false", "Infinity", "NaN", "null", "this", "true", "undefined"];
+        var valueKeywords = ["false", "Infinity", "NaN", "null", "this", "true", "undefined", "globalThis"];
 
         var allowedKeywordsInsideBlocks = allKeywords.keySet();
         var allowedKeywordsWhenDeclaringVariable = valueKeywords.keySet();