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

ASF GitHub Bot commented on CB-2845:
------------------------------------

Github user sgrebnov commented on the pull request:

    
https://github.com/apache/cordova-plugin-geolocation/pull/58#issuecomment-167549762
  
    @alsorokin please see if you can extend one of the tests you are currently 
working on to cover this test as well (PositionError can't be instantiated when 
using browser geolocation native api so there must be a test passing invalid 
params and testing resultant object)


> CompassError, PositionError constants not attached to prototype as specified 
> in W3C document
> --------------------------------------------------------------------------------------------
>
>                 Key: CB-2845
>                 URL: https://issues.apache.org/jira/browse/CB-2845
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Device Orientation, Plugin Geolocation
>    Affects Versions: 2.5.0, 2.6.0
>         Environment: Any
>            Reporter: Thomas K.
>              Labels: audit, triaged
>
> CompassError.js PositionError.js do not define the error constants on the 
> prototype of the object. Hence the constants are not passed into the error 
> function as specified in the W3C document 
> http://dev.w3.org/geo/api/spec-source.html#position_error_interface (see: 
> interface PositionError { const unsigned short PERMISSION_DENIED = 1; ...)
> Fix: define in the library PositionError.js and Compass.js constants 
> additionally like this:
> PositionError.prototype.PERMISSION_DENIED = 1;
> https://github.com/apache/incubator-cordova-js/blob/master/lib/common/plugin/PositionError.js#L34
> https://github.com/apache/incubator-cordova-js/blob/master/lib/common/plugin/CompassError.js#L31
> W3C compatible code is:
> positionError = function(gpsError)
>    {
>         switch(gpsError.code)
>         {
>             case gpsError.PERMISSION_DENIED:
>                 errorMessage = "Access to GPS denied!";
>                 break;
> ...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to