RESOLVED FIXED 193147
Web Inspector: Include `globalThis` in default JavaScript completions
https://bugs.webkit.org/show_bug.cgi?id=193147
Summary Web Inspector: Include `globalThis` in default JavaScript completions
Joseph Pecoraro
Reported 2019-01-04 11:00:01 PST
Include `globalThis` in default JavaScript completions
Attachments
[PATCH] Proposed Fix (1.67 KB, patch)
2019-01-04 11:00 PST, Joseph Pecoraro
no flags
Joseph Pecoraro
Comment 1 2019-01-04 11:00:44 PST
Created attachment 358336 [details] [PATCH] Proposed Fix
Devin Rousso
Comment 2 2019-01-04 11:49:59 PST
Comment on attachment 358336 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=358336&action=review r=me Is `globalThis` something we'd also want to always show in the Scope chain when paused? > Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js:661 > "return", "static", "super", "switch", "this", "throw", "true", "try", Should we be including `"globalThis"` in `allKeywords` as well? Ditto (727) (I can't comment on it because it's outside of this diff's range) > Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js:664 > + var valueKeywords = ["false", "Infinity", "NaN", "null", "this", "true", "undefined", "globalThis"]; `"globalThis"` should be placed before `"Infinity"` if we want to keep it alphabetized. NIT: considering how small this patch is, I wouldn't be against a bit of refactoring (e.g. `.keySet()` to `new Set()`)
Joseph Pecoraro
Comment 3 2019-01-04 12:04:04 PST
Comment on attachment 358336 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=358336&action=review >> Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js:661 >> "return", "static", "super", "switch", "this", "throw", "true", "try", > > Should we be including `"globalThis"` in `allKeywords` as well? > > Ditto (727) (I can't comment on it because it's outside of this diff's range) `globalThis` is not a keyword. >> Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js:664 >> + var valueKeywords = ["false", "Infinity", "NaN", "null", "this", "true", "undefined", "globalThis"]; > > `"globalThis"` should be placed before `"Infinity"` if we want to keep it alphabetized. > > NIT: considering how small this patch is, I wouldn't be against a bit of refactoring (e.g. `.keySet()` to `new Set()`) Good idea but I'll keep the code as is for now to avoid breaking something inadvertently.
WebKit Commit Bot
Comment 4 2019-01-04 12:29:34 PST
Comment on attachment 358336 [details] [PATCH] Proposed Fix Clearing flags on attachment: 358336 Committed r239630: <https://trac.webkit.org/changeset/239630>
WebKit Commit Bot
Comment 5 2019-01-04 12:29:36 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 6 2019-01-04 12:30:36 PST
Note You need to log in before you can comment on or make changes to this bug.