Closed Bug 1096339 Opened 10 years ago Closed 9 years ago

devtools console should support multiline string entry (es6 backtick string template)

Categories

(DevTools :: Console, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1243851

People

(Reporter: glind, Unassigned)

Details

To reproduce: devtools console: ``` let a = `start of a valid es6 string template string [ENTER key] ``` Gives: >>> SyntaxError: unterminated string literal Expected: string continuation prompt change. Observed: 1. Scratchpad works fine. 2. One line backtick strings work fine. Maybe: resource://gre/modules/devtools/dbg-client.jsm needs to know about 'enter'
Component: Developer Tools → Developer Tools: Console
Product: Developer Documentation → Firefox
Solutions: 1. Shift return. Works currently. (http://mxr.mozilla.org/mozilla-central/source/browser/devtools/webconsole/webconsole.js#3997) 2. Mod keyboard handler to do a partial parse to see if one is inside a potentially valid multiline input situation. Support continuation lines with new prompt etc. (http://mxr.mozilla.org/mozilla-central/source/browser/devtools/webconsole/webconsole.js#4018) 3. Quick hack: Mention the 'shift' trick in a little linked [?] after the 'Syntax Error: <whatever>' message. That should link / hover to either an explanation of the syntax error, and a mention of the multiline trick. (1) I should have thought of, but didn't. Is that my fault? (2) seems rightest / nicer to me, if the web-console is meant to be used as a cli. (3) New / different UI problems. Thanks!
This was fixed by Bug 1243851
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.