Closed
Bug 1905653
Opened 1 year ago
Closed 1 year ago
Escape inside template literals gets lost by prettify
Categories
(DevTools :: Debugger, defect)
DevTools
Debugger
Tracking
(firefox129 fixed)
RESOLVED
FIXED
129 Branch
Tracking | Status | |
---|---|---|
firefox129 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
Details
Attachments
(7 files)
167 bytes,
text/html
|
Details | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Steps to reproduce:
- Run Nightly 129.0a1 (2024-06-30) (64-bit) with clean profile on macOS
- Open the attached file
- Open DevTools Debugger and select the HTML file
- Click prettify button
Actual result:
The JS code is prettified like the following, where backslashes inside the template literal get lost and results in an invalid code
(the attached file contains unnecessary RegExp literal. please ignore it)
(function () {
return `foo `bar` baz \1`;
}) ();
Expected result:
The JS code is prettified like the following:
(function () {
return `foo \`bar\` baz \\1`;
}) ();
This comes from the template literal not being handled by PrettyFast.#writeToken
Assignee | ||
Comment 1•1 year ago
|
||
Assignee | ||
Comment 2•1 year ago
|
||
Assignee | ||
Comment 3•1 year ago
|
||
Assignee | ||
Comment 4•1 year ago
|
||
Assignee | ||
Comment 5•1 year ago
|
||
Assignee | ||
Comment 6•1 year ago
|
||
Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/b55060e097ca
Part 1: Handle template literals in pretty-fast. r=devtools-reviewers,nchevobbe
https://hg.mozilla.org/integration/autoland/rev/b833ffa9f4bc
Part 2: Bundle pretty-print-worker.js. r=devtools-reviewers,nchevobbe
https://hg.mozilla.org/integration/autoland/rev/8659368edf0d
Part 3: Add tests for template literals in pretty print. r=devtools-reviewers,nchevobbe
Comment 8•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b55060e097ca
https://hg.mozilla.org/mozilla-central/rev/b833ffa9f4bc
https://hg.mozilla.org/mozilla-central/rev/8659368edf0d
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
status-firefox129:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•