debugger icon indicating copy to clipboard operation
debugger copied to clipboard

[PrettyPrint] uncaught exception: SyntaxError: Unexpected character '`' (709:32)

Open magicp-github opened this issue 9 years ago • 9 comments

Steps to reproduce:

  1. Launch Nightly
  2. Navigate to "about:home" (about:newtab)
  3. Open Debugger (Ctrl+Shift+S)
  4. Open "resource://activity-stream/data/content/activity-stream.bundle.js"
  5. Click Pretty Print button
  6. 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.

magicp-github avatar Nov 08 '17 05:11 magicp-github

/claim

assafdd avatar Nov 16 '17 14:11 assafdd

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!

claim avatar Nov 16 '17 14:11 claim

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}))

assafdd avatar Nov 16 '17 14:11 assafdd

thanks for the repro. We can easily bump acorn in pretty-fast :)

jasonLaster avatar Nov 16 '17 14:11 jasonLaster

Just tested it locally and it solve the problem

assafdd avatar Nov 16 '17 15:11 assafdd

I'll send a PR on pretty-fast repo

assafdd avatar Nov 16 '17 15:11 assafdd

@jasonLaster once this PR https://github.com/mozilla/pretty-fast/pull/20 is approved we can bump pretty-fast here too.

assafdd avatar Nov 16 '17 20:11 assafdd

@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

assafdd avatar Nov 16 '17 21:11 assafdd

k

jasonLaster avatar Nov 16 '17 21:11 jasonLaster