Closed
Bug 924295
Opened 13 years ago
Closed 9 years ago
console.log(object) does not show a property when its name is an empty string
Categories
(DevTools :: Object Inspector, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 996691
People
(Reporter: igor, Unassigned)
References
Details
In Firefox 25 Beta console.log does not show an empty-string property name in an object. For example, console.log({"": 1}) printed [object Object]. When I clicked on that and expanded to see properties that just listed __proto__ without any mentioning of the empty string property with the value 1. Similarly console.log({"": 1, a: 2}) listed only "a" as a property without any mentioning of "".
| Reporter | ||
Updated•13 years ago
|
Summary: console.log does not show empty properties → console.log(object) does not show a property when its name is an empty string
| Reporter | ||
Comment 1•13 years ago
|
||
Another issue is that when a property name is whitespace, its value is not shown, even if the property listing reserves a space for it. console.log({" ": 1, "\t": 2, a: 3}) shows space for 3 properties, but the values for " " and "\t" are not given.
| Reporter | ||
Comment 2•13 years ago
|
||
Yet another issue is that properties with unprintable characters like "\x00" are shown as a whitespace. I think for debugging it would be better if any property that requires "" in the object literal should be shown as uneval(name).
Comment 3•13 years ago
|
||
My idea of why this would be useful is that you may be debugging code that creates objects and does not correctly set the name of a property.
Updated•12 years ago
|
Component: Developer Tools: Console → Developer Tools: Object Inspector
Updated•12 years ago
|
OS: Windows 7 → All
Hardware: x86 → All
Comment 5•11 years ago
|
||
(In reply to Brandon Benvie [:benvie] from comment #4)
> This should be fixed by bug 808371 landing.
Unfortunately, it doesn't look like it did get fixed; the object summary in the console lists the property, but the object inspector doesn't.
Comment 7•9 years ago
|
||
(In reply to Igor Bukanov from comment #0)
> In Firefox 25 Beta console.log does not show an empty-string property name
> in an object.
I fixed that in bug 996691.
(In reply to Igor Bukanov from comment #1)
> Another issue is that when a property name is whitespace, its value is not
> shown
I fixed that in bug 997219.
(In reply to Igor Bukanov from comment #2)
> Yet another issue is that properties with unprintable characters like "\x00"
> are shown as a whitespace.
I think that was fixed as a result of bug 909344
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Updated•8 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•