You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Andrew Grieve (JIRA)" <ji...@apache.org> on 2012/11/22 19:10:58 UTC

[jira] [Updated] (CB-1892) Refactor type-checking code in plugins into a helper method

     [ https://issues.apache.org/jira/browse/CB-1892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Grieve updated CB-1892:
------------------------------

    Description: 
ML Discussion: http://callback.markmail.org/thread/4vgze66wlaaxthsd

The idea is to add a typecheck module along the lines of:
argscheck.checkArgs('noasdf', 'testFunc', arguments);

where n=number, o=object, a=array, s=string, d=date, f=function, *=anything

Side-effects of this change will include:
1. All core plugins will have their callbacks be optional

2. Incorrect types will result in an exception thrown

3. Should reduce the size of cordova.js through removing repetitive code.

  was:
ML Discussion: http://callback.markmail.org/thread/4vgze66wlaaxthsd

The idea is to add a typecheck module along the lines of:
argscheck.checkArgs('noasdf', 'testFunc', arguments);

where n=number, o=object, a=array, s=string, d=date, f=function, *=anything

Side-effects of this change will include:
1. All core plugins will have their callbacks be optional

2. Incorrect types will result in an exception thrown

    
> Refactor type-checking code in plugins into a helper method
> -----------------------------------------------------------
>
>                 Key: CB-1892
>                 URL: https://issues.apache.org/jira/browse/CB-1892
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: CordovaJS
>            Reporter: Andrew Grieve
>            Assignee: Andrew Grieve
>            Priority: Minor
>             Fix For: 2.3.0
>
>
> ML Discussion: http://callback.markmail.org/thread/4vgze66wlaaxthsd
> The idea is to add a typecheck module along the lines of:
> argscheck.checkArgs('noasdf', 'testFunc', arguments);
> where n=number, o=object, a=array, s=string, d=date, f=function, *=anything
> Side-effects of this change will include:
> 1. All core plugins will have their callbacks be optional
> 2. Incorrect types will result in an exception thrown
> 3. Should reduce the size of cordova.js through removing repetitive code.

--
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