Closed Bug 1260756 Opened 6 years ago Closed 6 years ago

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


(DevTools :: Debugger, defect)

Not set


(firefox48 fixed)

Firefox 48
Tracking Status
firefox48 --- fixed


(Reporter: jsnajdr, Assigned: jsnajdr)



(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
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.