Closed Bug 1260756 Opened 4 years ago Closed 4 years ago

The SyntaxTreeVisitor in Parser.jsm fails to process template literals and function default arguments

Categories

(DevTools :: Debugger, defect)

defect
Not set

Tracking

(firefox48 fixed)

RESOLVED FIXED
Firefox 48
Tracking Status
firefox48 --- fixed

People

(Reporter: jsnajdr, Assigned: jsnajdr)

Details

Attachments

(2 files)

Steps to reproduce:
1. Try to debug a script like this:

function(first, second = "") {
  return `${first} + ${second}`;
}

2. Do something that involves running the SyntaxTreeVisitor. Either mouseover a variable name to trigger variable bubble view, or search in function names (@something).

Actual result:
The SyntaxTreeVisitor has two bugs that lead to TypeError:
1. No support for handling the TemplateLiteral type. Tries to call an undefined member function.
2. Incorrectly handles function defaults list where the first argument doesn't have any default. The defaults list for the function above is then [null, ""], and the code is not prepared for the "null". Happens for FunctionDefinition, FunctionExpression and ArrayFunctionExpression.
Assignee: nobody → jsnajdr
...except one error - "uneval" function is not defined.
Attachment #8736634 - Flags: review?(vporof)
Attachment #8736615 - Flags: review?(vporof) → review+
Attachment #8736634 - Flags: review?(vporof) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/2bc47d801b32
https://hg.mozilla.org/mozilla-central/rev/22e771b7f16c
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.