You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Peter (JIRA)" <ji...@apache.org> on 2013/07/08 07:25:49 UTC
[jira] [Created] (CB-4089) Undocumented API rule? Passing invalid
option values uses default value instead.
Peter created CB-4089:
-------------------------
Summary: Undocumented API rule? Passing invalid option values uses default value instead.
Key: CB-4089
URL: https://issues.apache.org/jira/browse/CB-4089
Project: Apache Cordova
Issue Type: Improvement
Components: Docs
Affects Versions: 2.7.0
Reporter: Peter
Assignee: Michael Brooks
Priority: Minor
It looks like there is some undocumented rule such that if an _invalid_ option value is passed via a Cordova API then the _default_ value will be used instead.
For example, the following calls are all equaivalent:
{code}
navigator.globalization.dateToString(new Date(), win, fail, {selector: 'banana'})
navigator.globalization.dateToString(new Date(), win, fail, {selector: 'date and time'})
navigator.globalization.dateToString(new Date(), win, fail, {})
{code}
I had (wrongly) expected 'banana' would result in some kind of API error since it is not a supported value for the selector.
This undocumented API rule should be documented.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira