Closed Bug 1819268 Opened 1 year ago Closed 1 year ago

Don't pass sourceFile option to acorn.tokenizer

Categories

(DevTools :: Debugger, task)

task

Tracking

(firefox112 fixed)

RESOLVED FIXED
112 Branch
Tracking Status
firefox112 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

Details

Attachments

(1 file)

https://searchfox.org/mozilla-central/rev/aa3ccd258b64abfd4c5ce56c1f512bc7f65b844c/devtools/client/debugger/src/workers/pretty-print/pretty-fast.js#978-983

function getTokens(input, options) {
  const tokens = [];

  const res = acorn.tokenizer(input, {
    locations: true,
    sourceFile: options.url,

This is probably not a big deal, but we don't make any use of this information on the token, as we have access to the URL when creating SourceNode

https://searchfox.org/mozilla-central/rev/aa3ccd258b64abfd4c5ce56c1f512bc7f65b844c/devtools/client/debugger/src/workers/pretty-print/pretty-fast.js#794

new SourceNode(bufferLine, bufferColumn, options.url, lineStr)

We don't make any use of this information, so we'd better not pass the option.

Depends on D171185

Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2da5ed051ee6
[devtools] Don't add sourceFile when fetching tokens for pretty-printing. r=jdescottes.
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/596dd10a439d
[devtools] Don't add sourceFile when fetching tokens for pretty-printing. r=jdescottes.
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e13f5a1fa3dd
[devtools] Don't add sourceFile when fetching tokens for pretty-printing. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: