* SUMMARY CodeMirrorTokenTrackingController handles symbols in class definitions incorrectly. CodeMirror throws an exception when hovering a class contractor or method definition. When walking tokens, we should be using `state.localState` instead of `state`, when available. Additionally, walking tokens while checking for object literal shorthand properties should halt if an open parenthesis is found. * REDUCTION <html> <script> class Foo { constructor() {} bar() {} }; debugger; </script> </html> * STEPS TO REPRODUCE 1. Inspect the above html 2. Reload the page, inspector pauses on `debugger` statement 3. Hover over the constructor or method in class Foo => Inspector crashes: External/CodeMirror/javascript.js:646:33: CONSOLE ERROR TypeError: state.tokenize is not a function. (In 'state.tokenize(stream, state)', 'state.tokenize' is undefined)
Created attachment 267252 [details] [Patch] Proposed Fix
Comment on attachment 267252 [details] [Patch] Proposed Fix Clearing flags on attachment: 267252 Committed r194013: <http://trac.webkit.org/changeset/194013>
All reviewed patches have been landed. Closing bug.
Comment on attachment 267252 [details] [Patch] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=267252&action=review > Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js:520 > WebInspector.walkTokens(this._codeMirror, mode, position, function(tokenType, string) { > if (tokenType) > return false; > + if (string === "(") > + return false; > if (string === "," || string === "}") { > shorthand = true; > return false; I thought we agreed on just checking for whitespace. return tokenType === null;
<rdar://problem/23883794>