[PrettyPrint] uncaught exception: SyntaxError: Unexpected character '`' (709:32)
Steps to reproduce:
- Launch Nightly
- Navigate to "about:home" (about:newtab)
- Open Debugger (Ctrl+Shift+S)
- Open "resource://activity-stream/data/content/activity-stream.bundle.js"
- Click Pretty Print button
- Check Browser console log
Actual Results: Pretty Print does not work. console log: uncaught exception: SyntaxError: Unexpected character '`' (709:32) (unknown)
Expected Results: Works with no error.
/claim
Thanks for claiming the issue! :wave:
Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.
:fox_face: Debugger team!
I dug a little in this issues. might be related to the acron.js version the debugger is using(currently very old one ~2.6.4 used in pretty-fast package). I was able to reproduce the exception with the following code snippet from the ticket (https://github.com/ternjs/acorn/issues/575) :
const acorn = require("acorn")
const code = `
\`\${ foo({class: 1}) }\`
`
console.log(acorn.version)
console.log(code)
console.log(acorn.parse(code, {ecmaVersion: 8}))
thanks for the repro. We can easily bump acorn in pretty-fast :)
Just tested it locally and it solve the problem
I'll send a PR on pretty-fast repo
@jasonLaster once this PR https://github.com/mozilla/pretty-fast/pull/20 is approved we can bump pretty-fast here too.
@jasonLaster I accidentally pushed this on the same branch of https://github.com/devtools-html/debugger.html/pull/4700/ ... So I revert it. and will push it on a seperate branch soon
k