Closed
Bug 1399782
Opened 8 years ago
Closed 8 years ago
Pasting a JSON object in DevTools Console should show as console.log
Categories
(DevTools :: Console, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 972530
People
(Reporter: petcuandrei, Unassigned)
Details
Attachments
(1 file)
|
26.00 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID: 20170913220121
Steps to reproduce:
Open devtolls console and paste this
{a:"test", b:5}
Actual results:
It displayed an error. "SyntaxError: missing ; before statement"
Expected results:
It should have displayed a nice object just like if I were to type
console.log({a:"test", b:5})
| Reporter | ||
Updated•8 years ago
|
Component: Untriaged → Developer Tools: Console
Comment 1•8 years ago
|
||
Hello Andrei,
I'm sure there is a bug somewhere for that.
The problem is that we evaluate what's entered in the console input, and `{var a = 2; b = a * 2}` is a valid block in Javascript.
We could detect that we have an object, and if so, log it, like Chrome does.
In the meantime, as a workaround you can wrap your json inside parenthesis, i.e. `({a: "test"})`
Updated•8 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•