[jira] [Commented] (CB-6291) [CLI] Implement dual promise/callback api

2014-03-18 Thread Lorin Beer (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13939699#comment-13939699
 ] 

Lorin Beer commented on CB-6291:


I'm looking into this now. In any case the current api had broken phonegap cli 
tests by not obeying callback arguments. I also started by writing failing 
tests which expected a callback argument. 

If that functionality was broken, then I can revert the commits so far.

 [CLI] Implement dual promise/callback api
 -

 Key: CB-6291
 URL: https://issues.apache.org/jira/browse/CB-6291
 Project: Apache Cordova
  Issue Type: Bug
  Components: CLI
Reporter: Lorin Beer
Assignee: Lorin Beer
Priority: Critical

 Master issue to manage the subissues involved in this task.
 in each subtask, the goal is to implement an optional promise/callback 
 interface. If a callback argument is supplied as the last parameter to a 
 function call which supports this api, then the callback is used and the 
 function returns null.
 If no callback is supplied, then a promise is returned.
 This upgrade should be non-breaking and backwards compatible.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CB-6291) [CLI] Implement dual promise/callback api

2014-03-17 Thread Andrew Grieve (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13938718#comment-13938718
 ] 

Andrew Grieve commented on CB-6291:
---

I think the API already worked like this.

Have a look at cordova.js and src/util.js

If you pass a function as the last arg, then the code in addModuleProperty 
calls it instead of returning a promise.



 [CLI] Implement dual promise/callback api
 -

 Key: CB-6291
 URL: https://issues.apache.org/jira/browse/CB-6291
 Project: Apache Cordova
  Issue Type: Bug
  Components: CLI
Reporter: Lorin Beer
Assignee: Lorin Beer
Priority: Critical

 Master issue to manage the subissues involved in this task.
 in each subtask, the goal is to implement an optional promise/callback 
 interface. If a callback argument is supplied as the last parameter to a 
 function call which supports this api, then the callback is used and the 
 function returns null.
 If no callback is supplied, then a promise is returned.
 This upgrade should be non-breaking and backwards compatible.



--
This message was sent by Atlassian JIRA
(v6.2#6252)