cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-2845) CompassError, PositionError constants not attached to prototype as specified in W3C document
Date Mon, 04 Jan 2016 08:05:40 GMT

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

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

Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-plugin-geolocation/pull/58


> 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: Sergey Grebnov
>              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: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message