Skip to content
Permalink
Browse files
Web Inspector: CodeMirrorTokenTrackingController handles symbols in c…
…lass definitions incorrectly

https://bugs.webkit.org/show_bug.cgi?id=152218

Reviewed by Timothy Hatcher.

* UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
(WebInspector.CodeMirrorTokenTrackingController.prototype._processJavaScriptExpression):
Stop checking for object literal shorthand property if an open parenthesis is found.
This check became necessary with the introduction of ES6 class syntax.

* UserInterface/Views/CodeMirrorAdditions.js:
Use localState when available, to prevent passing a state that doesn't define a tokenize property.


Canonical link: https://commits.webkit.org/170339@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194013 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
LuckyKobold committed Dec 13, 2015
1 parent 9408180 commit ded73c9c93946336746b3f603dfbbb5293043992
@@ -1,3 +1,18 @@
2015-12-12 Matt Baker <mattbaker@apple.com>

Web Inspector: CodeMirrorTokenTrackingController handles symbols in class definitions incorrectly
https://bugs.webkit.org/show_bug.cgi?id=152218

Reviewed by Timothy Hatcher.

* UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
(WebInspector.CodeMirrorTokenTrackingController.prototype._processJavaScriptExpression):
Stop checking for object literal shorthand property if an open parenthesis is found.
This check became necessary with the introduction of ES6 class syntax.

* UserInterface/Views/CodeMirrorAdditions.js:
Use localState when available, to prevent passing a state that doesn't define a tokenize property.

2015-12-12 Joseph Pecoraro <pecoraro@apple.com>

REGRESSION (r191613): Web Inspector: Can't type spaces when editing DOM nodes
@@ -513,6 +513,8 @@ WebInspector.CodeMirrorTokenTrackingController = class CodeMirrorTokenTrackingCo
WebInspector.walkTokens(this._codeMirror, mode, position, function(tokenType, string) {
if (tokenType)
return false;
if (string === "(")
return false;
if (string === "," || string === "}") {
shorthand = true;
return false;
@@ -627,8 +627,10 @@ WebInspector.compareCodeMirrorPositions = function(a, b)
WebInspector.walkTokens = function(cm, mode, initialPosition, callback)
{
let state = CodeMirror.copyState(mode, cm.getTokenAt(initialPosition).state);
let lineCount = cm.lineCount();
if (state.localState)
state = state.localState;

let lineCount = cm.lineCount();
let abort = false;
for (lineNumber = initialPosition.line; !abort && lineNumber < lineCount; ++lineNumber) {
let line = cm.getLine(lineNumber);

0 comments on commit ded73c9

Please sign in to comment.