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

RESOLVED FIXED in Firefox 48

Status

()

Firefox
Developer Tools: Debugger
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: jsnajdr, Assigned: jsnajdr)

Tracking

Trunk
Firefox 48
Points:
---

Firefox Tracking Flags

(firefox48 fixed)

Details

Attachments

(2 attachments)

(Assignee)

Description

2 years ago
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)

Updated

2 years ago
Assignee: nobody → jsnajdr
(Assignee)

Comment 1

2 years ago
Created attachment 8736615 [details] [diff] [review]
The SyntaxTreeVisitor in Parser.jsm fails to process template literals and function default arguments.
Attachment #8736615 - Flags: review?(vporof)
(Assignee)

Comment 2

2 years ago
https://treeherder.mozilla.org/#/jobs?repo=try&revision=0820bd17f3e9
(Assignee)

Comment 3

2 years ago
Created attachment 8736634 [details] [diff] [review]
make Parser.jsm ESLint-clean.

...except one error - "uneval" function is not defined.
Attachment #8736634 - Flags: review?(vporof)
(Assignee)

Comment 4

2 years ago
https://treeherder.mozilla.org/#/jobs?repo=try&revision=eac826d3ed4f
Attachment #8736615 - Flags: review?(vporof) → review+
Attachment #8736634 - Flags: review?(vporof) → review+
(Assignee)

Updated

2 years ago
Keywords: checkin-needed

Comment 5

2 years ago
https://hg.mozilla.org/integration/fx-team/rev/2bc47d801b32
https://hg.mozilla.org/integration/fx-team/rev/22e771b7f16c
Keywords: checkin-needed

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/2bc47d801b32
https://hg.mozilla.org/mozilla-central/rev/22e771b7f16c
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox48: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
You need to log in before you can comment on or make changes to this bug.