Closed Bug 933200 Opened 11 years ago Closed 11 years ago

[Contacts] hasOwnProperty not working properly on mozContact

Categories

(Core Graveyard :: DOM: Contacts, defect)

x86
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: gtorodelvalle, Unassigned)

References

Details

contact.hasOwnProperty(attr) is returning false even in the case when contact is a valid mozContact instance and attr is a contact property.

For example:

var contact = new mozContact({name: ["John Doe"], givenName: ["John"], familyName: ["Doe"]});
contact.hasOwnProperty('name'); // false when it should be true.
Array.isArray(contact.name); // true.
This is per spec, the attributes are on the prototype. Similarly, document.hasOwnProperty('body') returns false, window.hasOwnProperty('onload') returns false, etc.

You can do |"name" in c| or |c.__proto__.hasOwnProperty("name");|.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.