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)

defect
Not set
normal

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.
In case it's not obvious, in both cases, the Object.getOwnPropertyNames(e) should be ['message']
Also, check if the bug is in other error types just in case ;-)
Hu, interesting. I bet Waldo has some idea of what's going on.
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.