Title: [194013] trunk/Source/WebInspectorUI
Revision
194013
Author
mattba...@apple.com
Date
2015-12-12 21:09:44 -0800 (Sat, 12 Dec 2015)

Log Message

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.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (194012 => 194013)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-12-12 23:49:46 UTC (rev 194012)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-12-13 05:09:44 UTC (rev 194013)
@@ -1,3 +1,18 @@
+2015-12-12  Matt Baker  <mattba...@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  <pecor...@apple.com>
 
         REGRESSION (r191613): Web Inspector: Can't type spaces when editing DOM nodes

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js (194012 => 194013)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js	2015-12-12 23:49:46 UTC (rev 194012)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js	2015-12-13 05:09:44 UTC (rev 194013)
@@ -513,6 +513,8 @@
             WebInspector.walkTokens(this._codeMirror, mode, position, function(tokenType, string) {
                 if (tokenType)
                     return false;
+                if (string === "(")
+                    return false;
                 if (string === "," || string === "}") {
                     shorthand = true;
                     return false;

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js (194012 => 194013)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js	2015-12-12 23:49:46 UTC (rev 194012)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js	2015-12-13 05:09:44 UTC (rev 194013)
@@ -627,8 +627,10 @@
 WebInspector.walkTokens = function(cm, mode, initialPosition, callback)
 {
     let state = CodeMirror.copyState(mode, cm.getTokenAt(initialPosition).state);
+    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);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to