You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Oleg Gryb (Created) (JIRA)" <ji...@apache.org> on 2012/02/16 03:24:59 UTC

[jira] [Created] (CB-255) iOS: a parameter with value 'null' is not passed to 'arguments' array

iOS: a parameter with value 'null' is not passed to 'arguments' array 
----------------------------------------------------------------------

                 Key: CB-255
                 URL: https://issues.apache.org/jira/browse/CB-255
             Project: Apache Callback
          Issue Type: Bug
          Components: iOS
    Affects Versions: 1.4.0
         Environment: iOS Mac OS X 10.7
            Reporter: Oleg Gryb
            Assignee: Shazron Abdullah


In the following JS call the second parameter (null) will not be passed to 'arguments' array in a Objective-C controller.
The 'arguments' array will contain only first ('1') and third ('3') parameters. 
       
return PhoneGap.exec(successCallback,
                             failureCallback, 
                             VPCLASS,  
                             'method',
                             [1, null, 3]);

Hint: typeof(null) is equal to 'object' in JS. PhineGap.js uses this check to determine if a parameter should go to 'arguments' or to 'options' collections. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-255) iOS: a parameter with value 'null' is not passed to 'arguments' array

Posted by "Filip Maj (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13224517#comment-13224517 ] 

Filip Maj commented on CB-255:
------------------------------

First, for 1.6 and maybe a couple of point releases following it, we're aiming for full cordova-js integration and so let's move to the common approach of using just the arguments array.

That being said, I like the named parameter approach (I think it is clearer). After cordova-js is integrated into more platforms, I think we can open an issue in changing the parameterization approach.

Second, specific to this issue, definitely need to fix the missing "null" for, at the minimum for 1.6 as cordova-js lands in iOS.
                
> iOS: a parameter with value 'null' is not passed to 'arguments' array 
> ----------------------------------------------------------------------
>
>                 Key: CB-255
>                 URL: https://issues.apache.org/jira/browse/CB-255
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 1.4.0
>         Environment: iOS Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.0
>
>
> In the following JS call the second parameter (null) will not be passed to 'arguments' array in a Objective-C controller.
> The 'arguments' array will contain only first ('1') and third ('3') parameters. 
>        
> return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              [1, null, 3]);
> Hint: typeof(null) is equal to 'object' in JS. PhoneGap.js uses this check to determine if a parameter should go to 'arguments' or to 'options' collections. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CB-255) iOS: a parameter with value 'null' is not passed to 'arguments' array

Posted by "Shazron Abdullah (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shazron Abdullah updated CB-255:
--------------------------------

    Fix Version/s:     (was: 1.6.0)
                   1.7.0

1.5.0 change was reverted here: https://github.com/apache/incubator-cordova-js/blob/master/lib/ios/exec.js#L71
                
> iOS: a parameter with value 'null' is not passed to 'arguments' array 
> ----------------------------------------------------------------------
>
>                 Key: CB-255
>                 URL: https://issues.apache.org/jira/browse/CB-255
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 1.4.0
>         Environment: iOS Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.7.0
>
>
> In the following JS call the second parameter (null) will not be passed to 'arguments' array in a Objective-C controller.
> The 'arguments' array will contain only first ('1') and third ('3') parameters. 
>        
> return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              [1, null, 3]);
> Hint: typeof(null) is equal to 'object' in JS. PhoneGap.js uses this check to determine if a parameter should go to 'arguments' or to 'options' collections. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CB-255) iOS: a parameter with value 'null' is not passed to 'arguments' array

Posted by "Filip Maj (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Filip Maj updated CB-255:
-------------------------

    Component/s: CordovaJS
    
> iOS: a parameter with value 'null' is not passed to 'arguments' array 
> ----------------------------------------------------------------------
>
>                 Key: CB-255
>                 URL: https://issues.apache.org/jira/browse/CB-255
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 1.4.0
>         Environment: iOS Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.0
>
>
> In the following JS call the second parameter (null) will not be passed to 'arguments' array in a Objective-C controller.
> The 'arguments' array will contain only first ('1') and third ('3') parameters. 
>        
> return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              [1, null, 3]);
> Hint: typeof(null) is equal to 'object' in JS. PhoneGap.js uses this check to determine if a parameter should go to 'arguments' or to 'options' collections. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CB-255) iOS: a parameter with value 'null' is not passed to 'arguments' array

Posted by "Oleg Gryb (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Gryb updated CB-255:
-------------------------

    Description: 
In the following JS call the second parameter (null) will not be passed to 'arguments' array in a Objective-C controller.
The 'arguments' array will contain only first ('1') and third ('3') parameters. 
       
return PhoneGap.exec(successCallback,
                             failureCallback, 
                             VPCLASS,  
                             'method',
                             [1, null, 3]);

Hint: typeof(null) is equal to 'object' in JS. PhoneGap.js uses this check to determine if a parameter should go to 'arguments' or to 'options' collections. 

  was:
In the following JS call the second parameter (null) will not be passed to 'arguments' array in a Objective-C controller.
The 'arguments' array will contain only first ('1') and third ('3') parameters. 
       
return PhoneGap.exec(successCallback,
                             failureCallback, 
                             VPCLASS,  
                             'method',
                             [1, null, 3]);

Hint: typeof(null) is equal to 'object' in JS. PhineGap.js uses this check to determine if a parameter should go to 'arguments' or to 'options' collections. 

    
> iOS: a parameter with value 'null' is not passed to 'arguments' array 
> ----------------------------------------------------------------------
>
>                 Key: CB-255
>                 URL: https://issues.apache.org/jira/browse/CB-255
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.4.0
>         Environment: iOS Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>
> In the following JS call the second parameter (null) will not be passed to 'arguments' array in a Objective-C controller.
> The 'arguments' array will contain only first ('1') and third ('3') parameters. 
>        
> return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              [1, null, 3]);
> Hint: typeof(null) is equal to 'object' in JS. PhoneGap.js uses this check to determine if a parameter should go to 'arguments' or to 'options' collections. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (CB-255) iOS: a parameter with value 'null' is not passed to 'arguments' array

Posted by "Shazron Abdullah (Reopened) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shazron Abdullah reopened CB-255:
---------------------------------


Regression in 1.6.0. 
                
> iOS: a parameter with value 'null' is not passed to 'arguments' array 
> ----------------------------------------------------------------------
>
>                 Key: CB-255
>                 URL: https://issues.apache.org/jira/browse/CB-255
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 1.4.0
>         Environment: iOS Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.7.0
>
>
> In the following JS call the second parameter (null) will not be passed to 'arguments' array in a Objective-C controller.
> The 'arguments' array will contain only first ('1') and third ('3') parameters. 
>        
> return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              [1, null, 3]);
> Hint: typeof(null) is equal to 'object' in JS. PhoneGap.js uses this check to determine if a parameter should go to 'arguments' or to 'options' collections. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CB-255) iOS: a parameter with value 'null' is not passed to 'arguments' array

Posted by "Shazron Abdullah (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shazron Abdullah updated CB-255:
--------------------------------

    Fix Version/s: 1.6.0

Look at this issue for 1.6.0 after cordova-js has been integrated.
                
> iOS: a parameter with value 'null' is not passed to 'arguments' array 
> ----------------------------------------------------------------------
>
>                 Key: CB-255
>                 URL: https://issues.apache.org/jira/browse/CB-255
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.4.0
>         Environment: iOS Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.0
>
>
> In the following JS call the second parameter (null) will not be passed to 'arguments' array in a Objective-C controller.
> The 'arguments' array will contain only first ('1') and third ('3') parameters. 
>        
> return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              [1, null, 3]);
> Hint: typeof(null) is equal to 'object' in JS. PhoneGap.js uses this check to determine if a parameter should go to 'arguments' or to 'options' collections. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CB-255) iOS: a parameter with value 'null' is not passed to 'arguments' array

Posted by "Shazron Abdullah (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shazron Abdullah resolved CB-255.
---------------------------------

    Resolution: Fixed

Fix commit: http://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=commit;h=1cbb1e4d
                
> iOS: a parameter with value 'null' is not passed to 'arguments' array 
> ----------------------------------------------------------------------
>
>                 Key: CB-255
>                 URL: https://issues.apache.org/jira/browse/CB-255
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 1.4.0
>         Environment: iOS Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.7.0
>
>
> In the following JS call the second parameter (null) will not be passed to 'arguments' array in a Objective-C controller.
> The 'arguments' array will contain only first ('1') and third ('3') parameters. 
>        
> return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              [1, null, 3]);
> Hint: typeof(null) is equal to 'object' in JS. PhoneGap.js uses this check to determine if a parameter should go to 'arguments' or to 'options' collections. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CB-255) iOS: a parameter with value 'null' is not passed to 'arguments' array

Posted by "Shazron Abdullah (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shazron Abdullah resolved CB-255.
---------------------------------

    Resolution: Fixed
    
> iOS: a parameter with value 'null' is not passed to 'arguments' array 
> ----------------------------------------------------------------------
>
>                 Key: CB-255
>                 URL: https://issues.apache.org/jira/browse/CB-255
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 1.4.0
>         Environment: iOS Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.0
>
>
> In the following JS call the second parameter (null) will not be passed to 'arguments' array in a Objective-C controller.
> The 'arguments' array will contain only first ('1') and third ('3') parameters. 
>        
> return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              [1, null, 3]);
> Hint: typeof(null) is equal to 'object' in JS. PhoneGap.js uses this check to determine if a parameter should go to 'arguments' or to 'options' collections. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-255) iOS: a parameter with value 'null' is not passed to 'arguments' array

Posted by "Oleg Gryb (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13223688#comment-13223688 ] 

Oleg Gryb commented on CB-255:
------------------------------

After looking to the Cordova branches suggested by Filip Maj: 

https://github.com/filmaj/incubator-cordova-js
https://github.com/filmaj/incubator-cordova-ios

I think that what we need to do is to simplify arguments processing in Cordova.exec function as follows:
    for (var i = 0; i < actionArgs.length; ++i) {
        var arg = actionArgs[i];
//        if (arg == undefined || arg == null) {
//        if (arg == undefined) {
//            continue;
//        } else if (typeof(arg) == 'object') {
//            command.options = arg;
//        } else {
            command.arguments.push(arg);
//        }
    }


It will lead to the following effects:

1. options collection will be always empty. Does anyone really care? Can we put all elements to 'arguments' just like in Android's case?
2. null parameter will be passed to 'arguments' as an NSNull object, which would be perfect in my view.

Please let me know you thoughts. I think, we still need to keep the 'withDict:(NSMutableDictionary *)options' parameter in iOS methods for backward compatibility.


                
> iOS: a parameter with value 'null' is not passed to 'arguments' array 
> ----------------------------------------------------------------------
>
>                 Key: CB-255
>                 URL: https://issues.apache.org/jira/browse/CB-255
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.4.0
>         Environment: iOS Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.0
>
>
> In the following JS call the second parameter (null) will not be passed to 'arguments' array in a Objective-C controller.
> The 'arguments' array will contain only first ('1') and third ('3') parameters. 
>        
> return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              [1, null, 3]);
> Hint: typeof(null) is equal to 'object' in JS. PhoneGap.js uses this check to determine if a parameter should go to 'arguments' or to 'options' collections. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-255) iOS: a parameter with value 'null' is not passed to 'arguments' array

Posted by "Shazron Abdullah (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13227805#comment-13227805 ] 

Shazron Abdullah commented on CB-255:
-------------------------------------

We still need to support options like Fil mentioned. I've checked in the change to support nulls.
https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-ios.git;a=blobdiff;f=CordovaLib/javascripts/core/cordova.js.base;h=be1cbdf650fdba91515a7e554ba42d9dc24db0c5;hp=98be37bd318893e86e15e86bd9d974bcc13ab39b;hb=f47a9a083afc5e7dda201723da5bd8dafe56621f;hpb=71a542e8d0f39a9f7f75c782d03007841c3d310b
                
> iOS: a parameter with value 'null' is not passed to 'arguments' array 
> ----------------------------------------------------------------------
>
>                 Key: CB-255
>                 URL: https://issues.apache.org/jira/browse/CB-255
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 1.4.0
>         Environment: iOS Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.0
>
>
> In the following JS call the second parameter (null) will not be passed to 'arguments' array in a Objective-C controller.
> The 'arguments' array will contain only first ('1') and third ('3') parameters. 
>        
> return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              [1, null, 3]);
> Hint: typeof(null) is equal to 'object' in JS. PhoneGap.js uses this check to determine if a parameter should go to 'arguments' or to 'options' collections. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira