Closed
Bug 688401
Opened 14 years ago
Closed 12 years ago
Web Console displays "[null]" for [Object.create(null)]
Categories
(DevTools :: Console, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 23
People
(Reporter: bruant.d, Unassigned)
References
Details
< console.log( [Object.create(null)] )
> [null]
What is logged is not an array with one null element. It's an array with one object
Comment 1•13 years ago
|
||
this is pretty fringe. For whatever reason, Object.create(null) in the console is return null. |null| isn't extensible?
Status: NEW → RESOLVED
Closed: 13 years ago
Component: Developer Tools → Developer Tools: Console
Resolution: --- → WONTFIX
Reporter | ||
Comment 2•13 years ago
|
||
(In reply to Rob Campbell [:rc] (:robcee) from comment #1)
> this is pretty fringe. For whatever reason, Object.create(null) in the
> console is return null. |null| isn't extensible?
I don't understand what you mean here. In JavaScript, null is a value, very much like undefined.
Object.create(null) creates an object (with properties, etc.) which [[Prototype]] is null, so it's an object, so I think it should be logged differently than the null value to avoid the confusion.
When the console displays "[null]" for [Object.create(null)], it makes it undistinguishable from [null] (an array with one element which value is null). It may be fringe, but it's wrong and misleading when you actually use it.
I'm taking the freedom to reopen as I think the ambiguity the console creates is worth fixing.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Reporter | ||
Comment 5•12 years ago
|
||
Fixed indeed after Bug 783499.
Thanks :-)
Status: REOPENED → RESOLVED
Closed: 13 years ago → 12 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Target Milestone: --- → Firefox 23
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•