[ 
https://issues.apache.org/jira/browse/CB-298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13266020#comment-13266020
 ] 

Filip Maj edited comment on CB-298 at 5/1/12 8:07 PM:
------------------------------------------------------

Nevermind, I was wrong. Sorry Shaz.

Just wrote up a test to prove what's going on. {{deprecateFunctions}} creates a 
completely new object. This causes {{exec}} to not exist on the {{PhoneGap}} 
and {{Cordova}} globals as they no longer reference the {{cordova}} object 
directly by reference.

The test is here: https://github.com/filmaj/incubator-cordova-js/tree/apitests

You can run the above test, and in cordova.js, swap between using 
{{deprecateFunctions}} and not, and see the failing tests in each case.
                
      was (Author: filmaj):
    Nevermind, I was wrong. Sorry Shaz.

Just wrote up a test to prove what's going on. The new object reference created 
by {{deprecateFunctions}} causes exec to not exist on the root {{cordova}} 
object. The {{PhoneGap}} and {{Cordova}} globals reference the {{cordova}} 
object directly by reference prior to the fix commit in this issue, and thus 
get the {{exec}} method once it is tacked on via the platform definition 
common.js file.

The test is here: https://github.com/filmaj/incubator-cordova-js/tree/apitests

You can run the above test, and in cordova.js, swap between using 
{{deprecateFunctions}} and not, and see the failing tests in each case.
                  
> DEPRECATE "plugins" and "PhoneGap" global objects in JavaScript implementation
> ------------------------------------------------------------------------------
>
>                 Key: CB-298
>                 URL: https://issues.apache.org/jira/browse/CB-298
>             Project: Apache Callback
>          Issue Type: Improvement
>          Components: CordovaJS
>    Affects Versions: 1.4.0, 1.5.0, 1.6.0
>            Reporter: Filip Maj
>            Assignee: Shazron Abdullah
>            Priority: Minor
>              Labels: api-change, javascript
>             Fix For: 1.7.0
>
>
> There are two globals currently defined in Cordova-JS' common platform 
> definition, which get dropped onto the `window` object: `plugins` and 
> `PhoneGap`.
> Let's slate these for removal.
> In 1.6, let's set up deprecation notices for these.

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

        

Reply via email to