Changeset 194013 in webkit


Ignore:
Timestamp:
Dec 12, 2015 9:09:44 PM (8 years ago)
Author:
Matt Baker
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.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r194009 r194013  
     12015-12-12  Matt Baker  <mattbaker@apple.com>
     2
     3        Web Inspector: CodeMirrorTokenTrackingController handles symbols in class definitions incorrectly
     4        https://bugs.webkit.org/show_bug.cgi?id=152218
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
     9        (WebInspector.CodeMirrorTokenTrackingController.prototype._processJavaScriptExpression):
     10        Stop checking for object literal shorthand property if an open parenthesis is found.
     11        This check became necessary with the introduction of ES6 class syntax.
     12
     13        * UserInterface/Views/CodeMirrorAdditions.js:
     14        Use localState when available, to prevent passing a state that doesn't define a tokenize property.
     15
    1162015-12-12  Joseph Pecoraro  <pecoraro@apple.com>
    217
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js

    r192048 r194013  
    514514                if (tokenType)
    515515                    return false;
     516                if (string === "(")
     517                    return false;
    516518                if (string === "," || string === "}") {
    517519                    shorthand = true;
  • trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js

    r192040 r194013  
    628628{
    629629    let state = CodeMirror.copyState(mode, cm.getTokenAt(initialPosition).state);
     630    if (state.localState)
     631        state = state.localState;
     632
    630633    let lineCount = cm.lineCount();
    631 
    632634    let abort = false;
    633635    for (lineNumber = initialPosition.line; !abort && lineNumber < lineCount; ++lineNumber) {
Note: See TracChangeset for help on using the changeset viewer.