- From: Huang, Deqing <deqing.huang@intel.com>
- Date: Thu, 19 Dec 2013 05:14:28 +0000
- To: Christophe Dumez <ch.dumez@sta.samsung.com>, "public-sysapps@w3.org" <public-sysapps@w3.org>
- Message-ID: <B35B9DE5A1BEDC4CAA7DF89D69DF3C3810CD2971@SHSMSX104.ccr.corp.intel.com>
Thanks for the explanation. Is it possible to design a test case for "not nullable" of find() argument? Regards, Deqing From: Christophe Dumez [mailto:ch.dumez@sta.samsung.com] Sent: Wednesday, December 18, 2013 10:54 PM To: Huang, Deqing; public-sysapps@w3.org; Christophe Dumez Subject: Re: Method parameter - optional but not nullable Hi, Yes, optional and nullable mean different things in Web IDL. find is specified as follows: Promise<http://www.w3.org/2012/sysapps/contacts-manager-api/#dfn-promise> find<http://www.w3.org/2012/sysapps/contacts-manager-api/#widl-ContactsManager-find-Promise-ContactFindOptions-options> (optional ContactFindOptions<http://www.w3.org/2012/sysapps/contacts-manager-api/#idl-def-ContactFindOptions> options); As per Web IDL [1], Dictionaries are not nullable when used as the type of an operation argument (or a dictionary member). So null will never be passed to the implementation of find(). However, calling "navigator.contacts.find(null);" will not throw. Instead, null will be converted to a dictionary as defined by Web IDL [2] and that dictionary will be passed to the implementation of find(). [1] http://heycam.github.io/webidl/#idl-nullable-type [2] http://heycam.github.io/webidl/#es-dictionary (See Step 5.2. if Type(V) is Null) Kr, On 12/18/2013 05:03 AM, Huang, Deqing wrote: Hi, In Contacts Manager API spec, parameter "option" of find() is optional but not nullable: http://www.w3.org/2012/sysapps/contacts-manager-api/#widl-ContactsManager-find-Promise-ContactFindOptions-options What does that mean? Is there any difference between optional and nullable? Thanks in advance. Regards, Deqing -- Christophe Dumez - Samsung Telecommunications America
Received on Thursday, 19 December 2013 05:15:03 UTC