Changeset 246667 in webkit


Ignore:
Timestamp:
Jun 20, 2019 6:21:08 PM (5 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Error "null is not an object (evaluating 'syntaxTree.containersOfPosition')" when setting a breakpoint
https://bugs.webkit.org/show_bug.cgi?id=199082

Reviewed by Matt Baker.

  • UserInterface/Views/SourceCodeTextEditor.js:

(WI.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
The script syntax tree may be fetched even if the resource hasn't finished parsing (or had
a syntax error), so it's possible for it to be null.

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r246666 r246667  
     12019-06-20  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Error "null is not an object (evaluating 'syntaxTree.containersOfPosition')" when setting a breakpoint
     4        https://bugs.webkit.org/show_bug.cgi?id=199082
     5
     6        Reviewed by Matt Baker.
     7
     8        * UserInterface/Views/SourceCodeTextEditor.js:
     9        (WI.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
     10        The script syntax tree may be fetched even if the resource hasn't finished parsing (or had
     11        a syntax error), so it's possible for it to be `null`.
     12
    1132019-06-20  Devin Rousso  <drousso@apple.com>
    214
  • trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js

    r246659 r246667  
    14381438
    14391439        script.requestScriptSyntaxTree((syntaxTree) => {
     1440            // After requesting the tree, we still might get a null tree from a parse error.
     1441            if (!syntaxTree) {
     1442                callback(null);
     1443                return;
     1444            }
     1445
    14401446            // Convert to the position within the inline script before querying the AST.
    14411447            position = toInlineScriptPosition(position);
Note: See TracChangeset for help on using the changeset viewer.