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

Sergey Shakhnazarov resolved CB-8958.
-------------------------------------
    Resolution: Fixed

Fixed in CB-12353

> CommandProxy functions for multiple plugins get clobbered if same function 
> name is used
> ---------------------------------------------------------------------------------------
>
>                 Key: CB-8958
>                 URL: https://issues.apache.org/jira/browse/CB-8958
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Windows
>    Affects Versions: 3.6.3
>         Environment: windows
>            Reporter: Ashwin Desai
>
> Project: https://github.com/ashwinde/cordova/tree/master/TestMerges
> Cordova version: 3.6.4
> I have added 2 plugins - InAppBrowser and TestPlugin to this cordova project 
> on Windows.
> Each plugin define a close() and show() functions i.e. functions with same 
> names. 
> Each plugin.xml defines the commandProxy with merges=""
> Run the sample.
> InAppBrowser window will be opened to display google.com
> Click on "x" close button on the inappbrowser window.
> You will notice that the TestPlugin.close() method is invoked rather than 
> IAB.close(). 
> The problem is that both plugins use merges="" for defining their own command 
> proxies. since both plugins use the same function names i.e. close() and 
> show(), cordova.js will clobber the close() and show() function for the IAB 
> command proxy with the TestPlugin command proxy. 
> That is a common pattern that is being used by all cordova plugins on 
> Windows. So, it may manifest itself when 2 plugins use the same function name 
> (yet in a different namespace)
> A better way to do this would be to use merges = "unique string" to define 
> the command proxy for a plugin. This would guarantee that functions dont get 
> clobbered inadvertently. 
> Or fix cordova.js so that this clobbering does not occur :)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to