Closed
Bug 895043
Opened 11 years ago
Closed 11 years ago
Object.getOwnPropertyNames(new Error('bla')).length === 0 (should be 1)
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
DUPLICATE
of bug 724768
People
(Reporter: bruant.d, Unassigned)
Details
var e = new Error('bla');
console.log(Object.getOwnPropertyNames(e).length) // 0, should be 1
console.log(e.message) // 'bla' as expected
console.log(Object.getOwnPropertyNames(e).length) // 1 as expected
I imagine that getting the property makes it appear in some way. In any case, the second line has an unexpected behavior.
Reporter | ||
Comment 1•11 years ago
|
||
In case it's not obvious, in both cases, the Object.getOwnPropertyNames(e) should be ['message']
Reporter | ||
Comment 2•11 years ago
|
||
Also, check if the bug is in other error types just in case ;-)
Comment 3•11 years ago
|
||
Hu, interesting. I bet Waldo has some idea of what's going on.
Updated•11 years ago
|
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•