Visualize console.log empty string output
Categories
(DevTools :: Console, defect, P3)
Tracking
(firefox57 wontfix, firefox72 verified)
People
(Reporter: shimscharf, Assigned: nchevobbe)
Details
Attachments
(1 file)
Reporter | ||
Comment 1•8 years ago
|
||
Updated•8 years ago
|
Assignee | ||
Comment 2•8 years ago
|
||
Reporter | ||
Comment 3•8 years ago
|
||
Assignee | ||
Comment 4•8 years ago
|
||
Comment 5•8 years ago
|
||
Comment 6•8 years ago
|
||
Updated•7 years ago
|
Assignee | ||
Comment 7•6 years ago
|
||
It just occurred to me this morning that in the case we don't show quotes, we could render something like <empty string>
to make it clear.
So here devtools/client/debugger/packages/devtools-reps/src/reps/string.js#77-83 , we could have something like:
if (!useQuotes && text == "") {
return span({
className: "empty-string-rep"
}, "<empty string>")
}
we could then style the empty-string-rep
class with the comment color so it's a bit dimmed.
Assignee | ||
Comment 8•6 years ago
|
||
This only affects console api calls where one of the
argument is an empty string. Since we don't quote
string arguments for those, it was difficult to spot
an empty string there.
Jest test are added, as well as a mochitest for the
console to make sure that we don't have unwanted
side effects (for evaluation results, object with
empty string properties, ...)
Updated•6 years ago
|
Comment 10•6 years ago
|
||
bugherder |
Comment 11•6 years ago
|
||
Verified fixed on Windows 10, Mac 10.15 and Ubuntu 18.04 using Firefox 72.0a1 (20191128214853)
Comment 12•4 years ago
|
||
What if I don;t want to see "<empty string>" in console, just a blank row? An option to set what is display for "" would be nice.
Comment 13•4 years ago
|
||
(In reply to prostyler from comment #12)
What if I don't want to see "<empty string>" in console, just a blank row? An option to set what is display for "" would be nice.
Assignee | ||
Comment 14•4 years ago
|
||
(In reply to prostyler from comment #12)
What if I don;t want to see "<empty string>" in console, just a blank row? An option to set what is display for "" would be nice.
You can achieve this by logging a space char (console.log(" ")
) or a new line (console.log("\n")
).
Comment 15•4 years ago
|
||
Option for firefox, to display console.log('') | console.log(' ') | console.log('\n') as user want to, would be best. I simply cannot change the code that WAS displayed properly in firefox (also chrome/chromium and all browsers that use this engine).
Description
•