Closed
Bug 929435
Opened 11 years ago
Closed 11 years ago
Treat undefined DOMStrings as null in the Contacts API
Categories
(Core Graveyard :: DOM: Contacts, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla28
People
(Reporter: jmcf, Assigned: reuben)
References
Details
(Keywords: regression)
Attachments
(2 files)
20.74 KB,
image/png
|
Details | |
4.77 KB,
patch
|
gwagner
:
review+
|
Details | Diff | Splinter Review |
if a SIM contact does not have any associated phone number mozICcManager.readContacts is returning a contact which on the tel field contains array with one element and the 'string' undefined as tel.value.
Reporter | ||
Comment 1•11 years ago
|
||
this is happening on master branch and master gaia. Don't know if it is happening on koi.
Reporter | ||
Updated•11 years ago
|
Whiteboard: qawanted
Reporter | ||
Comment 2•11 years ago
|
||
at UI level this is what is happening
Comment 3•11 years ago
|
||
Not sure is it the same case as bug 808220 comment #14 and bug 808220 comment #16.
Updated•11 years ago
|
Assignee: nobody → gwang
Comment 4•11 years ago
|
||
Cannot reproduce this on v1.2 (10/28 build): Gecko-e8d81ae Gaia-2ef9bc3
Whiteboard: qawanted
Comment 5•11 years ago
|
||
This is an XPCOM/IDL problem. And the regression is due to bug 850430 Contacts API: Use WebIDL Originally, string parser will check if string = undefined when parsing. This part was removed after use WebIDL. https://hg.mozilla.org/mozilla-central/rev/533d30be7e6e 2.36 -function sanitizeStringArray(aArray) { 2.37 - if (!Array.isArray(aArray)) { 2.38 - aArray = [aArray]; 2.39 - } 2.40 - return aArray.map(stringOrBust).filter(function(el) { return el != undefined; }); 2.41 -} 2.42 +ContactAddress.prototype = { 2.43 + // This function is meant to be called via bindings code for type checking, 2.44 + // don't call it directly. Instead, create a content object and call initialize 2.45 + // on that. 2.46 + initialize: function(aType, aStreetAddress, aLocality, aRegion, aPostalCode, aCountryName, aPref) { 2.47 + this.type = aType; 2.48 + this.streetAddress = aStreetAddress; 2.49 + this.locality = aLocality; 2.50 + this.region = aRegion; 2.51 + this.postalCode = aPostalCode; 2.52 + this.countryName = aCountryName; 2.53 + this.pref = aPref; 2.54 + }, Dear Reuben, Could you help check?
Flags: needinfo?(reuben.bmo)
Updated•11 years ago
|
Updated•11 years ago
|
Component: DOM: Device Interfaces → DOM: Contacts
Assignee | ||
Updated•11 years ago
|
Assignee: gwang → reuben.bmo
Flags: needinfo?(reuben.bmo)
Summary: navigator.mozIccManager is returning the string 'undefined' for SIM contacts without tel number → Treat undefined DOMStrings as null in the Contacts API
Assignee | ||
Comment 6•11 years ago
|
||
Attachment #824947 -
Flags: review?(anygregor)
Updated•11 years ago
|
Attachment #824947 -
Flags: review?(anygregor) → review+
Assignee | ||
Comment 7•11 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/14215376a810
Comment 8•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/14215376a810
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Comment 9•11 years ago
|
||
Er.... why was this change to introduce [TreatUndefinedAs=Null] needed? For an nullable string, that's already the default behavior. And in fact, if I simply back this patch out the codegen doesn't change at all. So what was the effect of this patch? Did the test that was checked in actually fail without it?
Updated•6 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•