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

Filip Maj updated CB-2845:
--------------------------

      Component/s:     (was: CordovaJS)
                   Plugin Geolocation
                   Plugin Device Orientation
    Fix Version/s:     (was: 3.0.0)
         Assignee: Steve Gill  (was: Filip Maj)
           Labels: audit  (was: )

Tagging relevant plugins and added audit label. Should revisit this issue once 
we do API audit after 3.0.
                
> 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.
>            Assignee: Steve Gill
>            Priority: Minor
>              Labels: audit
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to