You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/12/28 12:32:49 UTC

[jira] [Commented] (CB-2845) CompassError, PositionError constants not attached to prototype as specified in W3C document

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

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

GitHub user sgrebnov opened a pull request:

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

    CB-2845 PositionError constants not attached to prototype as per W3C

    https://issues.apache.org/jira/browse/CB-2845

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MSOpenTech/cordova-plugin-geolocation CB-2845

Alternatively you can review and apply these changes as the patch at:

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

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #58
    
----
commit d0b6f8c972c41328a555b203b0a41a492d375396
Author: sgrebnov <v-...@microsoft.com>
Date:   2015-12-28T11:31:44Z

    CB-2845 PositionError constants not attached to prototype as specified in W3C document
    
    https://issues.apache.org/jira/browse/CB-2845

----


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