You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "tribalvibes (Created) (JIRA)" <ji...@apache.org> on 2012/04/16 00:33:17 UTC

[jira] [Created] (CB-516) ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth

ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth
--------------------------------------------------------------------------

                 Key: CB-516
                 URL: https://issues.apache.org/jira/browse/CB-516
             Project: Apache Callback
          Issue Type: Bug
          Components: iOS
    Affects Versions: 1.6.0
            Reporter: tribalvibes
            Assignee: Shazron Abdullah


Debug console logging of objects throws EXCEPTION: Can't find variable: maxDepth  because makeStructured fails to recurse the maxDepth parameter correctly. 

--
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-516) ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth

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

Shazron Abdullah commented on CB-516:
-------------------------------------

The main issue here is relying on the brittle maxDepth variable which is global and is polluting the global namespace unnecessarily.
                
> ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth
> --------------------------------------------------------------------------
>
>                 Key: CB-516
>                 URL: https://issues.apache.org/jira/browse/CB-516
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.6.0
>            Reporter: tribalvibes
>            Assignee: Shazron Abdullah
>
> Debug console logging of objects throws EXCEPTION: Can't find variable: maxDepth  because makeStructured fails to recurse the maxDepth parameter correctly. 

--
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-516) ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth

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

Shazron Abdullah resolved CB-516.
---------------------------------

    Resolution: Fixed

Fix commit: http://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=commit;h=2de1d613
                
> ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth
> --------------------------------------------------------------------------
>
>                 Key: CB-516
>                 URL: https://issues.apache.org/jira/browse/CB-516
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.6.0
>            Reporter: tribalvibes
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.1
>
>
> Debug console logging of objects throws EXCEPTION: Can't find variable: maxDepth  because makeStructured fails to recurse the maxDepth parameter correctly. 

--
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-516) ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth

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

Shazron Abdullah updated CB-516:
--------------------------------

    Component/s:     (was: iOS)
                 CordovaJS

Offending line: https://github.com/apache/incubator-cordova-js/blob/master/lib/ios/plugin/ios/console.js#L16
                
> ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth
> --------------------------------------------------------------------------
>
>                 Key: CB-516
>                 URL: https://issues.apache.org/jira/browse/CB-516
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.6.0
>            Reporter: tribalvibes
>            Assignee: Shazron Abdullah
>
> Debug console logging of objects throws EXCEPTION: Can't find variable: maxDepth  because makeStructured fails to recurse the maxDepth parameter correctly. 

--
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-516) ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth

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

Shazron Abdullah updated CB-516:
--------------------------------

    Fix Version/s: 1.6.1
    
> ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth
> --------------------------------------------------------------------------
>
>                 Key: CB-516
>                 URL: https://issues.apache.org/jira/browse/CB-516
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.6.0
>            Reporter: tribalvibes
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.1
>
>
> Debug console logging of objects throws EXCEPTION: Can't find variable: maxDepth  because makeStructured fails to recurse the maxDepth parameter correctly. 

--
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-516) ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth

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

tribalvibes commented on CB-516:
--------------------------------

it's being passed in as a parameter, but the declaration is wrong. I've patched it locally as:
```
function makeStructured(obj, maxDepth, depth) {
    var str = "";
    for (var i in obj) {
        try {
            if (typeof(obj[i]) == 'object' && depth && maxDepth && depth < maxDepth) {
                str += i + ":\n" + indent(makeStructured(obj[i],maxDepth,(depth||0)+1)) + "\n";
```

                
> ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth
> --------------------------------------------------------------------------
>
>                 Key: CB-516
>                 URL: https://issues.apache.org/jira/browse/CB-516
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.6.0
>            Reporter: tribalvibes
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.1
>
>
> Debug console logging of objects throws EXCEPTION: Can't find variable: maxDepth  because makeStructured fails to recurse the maxDepth parameter correctly. 

--
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-516) ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth

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

tribalvibes commented on CB-516:
--------------------------------

You could please patch it from the above. I'm just guessing as to the original intent. This could just as well be deleted.  I think the duplicity of having this hosted here on jira but then using github for pull requests is wasteful. What are the politics preventing this from just being hosted on github.
                
> ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth
> --------------------------------------------------------------------------
>
>                 Key: CB-516
>                 URL: https://issues.apache.org/jira/browse/CB-516
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.6.0
>            Reporter: tribalvibes
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.1
>
>
> Debug console logging of objects throws EXCEPTION: Can't find variable: maxDepth  because makeStructured fails to recurse the maxDepth parameter correctly. 

--
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-516) ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth

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

tribalvibes commented on CB-516:
--------------------------------

er,

            if (typeof(obj[i]) == 'object' && maxDepth && (depth||0) < maxDepth) {
                str += i + ":\n" + indent(makeStructured(obj[i],maxDepth,(depth||0)+1)) + "\n";

                
> ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth
> --------------------------------------------------------------------------
>
>                 Key: CB-516
>                 URL: https://issues.apache.org/jira/browse/CB-516
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.6.0
>            Reporter: tribalvibes
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.1
>
>
> Debug console logging of objects throws EXCEPTION: Can't find variable: maxDepth  because makeStructured fails to recurse the maxDepth parameter correctly. 

--
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-516) ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth

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

Shazron Abdullah commented on CB-516:
-------------------------------------

It's a long discussion (see callback-dev mailing list) - but it's Apache policy unfortunately, for now. I'll patch it for you, thanks.
                
> ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth
> --------------------------------------------------------------------------
>
>                 Key: CB-516
>                 URL: https://issues.apache.org/jira/browse/CB-516
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.6.0
>            Reporter: tribalvibes
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.1
>
>
> Debug console logging of objects throws EXCEPTION: Can't find variable: maxDepth  because makeStructured fails to recurse the maxDepth parameter correctly. 

--
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-516) ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth

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

Shazron Abdullah commented on CB-516:
-------------------------------------

>From what I can see there is no maxDepth in the function signature:
{code}
function makeStructured(obj, depth) {
   // ....
}
{code}

.. that was the original source of the error, but I see from your further comments you've provided a better solution. If you want to send a pull-request to cordova-js, please do so, if not I can just patch the code for you.



                
> ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth
> --------------------------------------------------------------------------
>
>                 Key: CB-516
>                 URL: https://issues.apache.org/jira/browse/CB-516
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.6.0
>            Reporter: tribalvibes
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.1
>
>
> Debug console logging of objects throws EXCEPTION: Can't find variable: maxDepth  because makeStructured fails to recurse the maxDepth parameter correctly. 

--
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-516) ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth

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

Shazron Abdullah commented on CB-516:
-------------------------------------

Decided to remove makeStructured - redundant with iOS > 3 since JSON lib is included in UIWebView after that. See CB-518
                
> ios/console#makeStructured throws EXCEPTION: Can't find variable: maxDepth
> --------------------------------------------------------------------------
>
>                 Key: CB-516
>                 URL: https://issues.apache.org/jira/browse/CB-516
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.6.0
>            Reporter: tribalvibes
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.1
>
>
> Debug console logging of objects throws EXCEPTION: Can't find variable: maxDepth  because makeStructured fails to recurse the maxDepth parameter correctly. 

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