Calling hasOwnProperty('detail') on a CustomEvent that was instantiated with {detail: something} returns false

RESOLVED INVALID

Status

()

RESOLVED INVALID
6 years ago
5 years ago

People

(Reporter: jordan.garcia, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36

Steps to reproduce:

var c = new CustomEvent('someEvent', {detail: 'bar'}); Object.prototype.hasOwnProperty.call(c, 'detail');


Actual results:

returns false


Expected results:

returns true
It seems to be similar to bug 879605
Assignee: nobody → general
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
It does, yes. Also reproducible with the simpler

var c = new CustomEvent('someEvent', {detail: 'bar'});
c.hasOwnProperty('detail');
Assignee: general → nobody
Component: JavaScript Engine → DOM
OS: Mac OS X → All
Hardware: x86 → All
Version: 21 Branch → Trunk
detail is a getter in the prototype object of CustomEvent, not in the event itself.
Blink and webkit tend to put properties to the object itself, not to the prototype as the
specs says.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → INVALID
(Reporter)

Comment 4

6 years ago
Olli,

Could you please link to the part of the spec that mentions this.  I could not find it.

Thanks
You need to log in before you can comment on or make changes to this bug.