You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Sergey Grebnov (JIRA)" <ji...@apache.org> on 2015/12/28 12:39:49 UTC
[jira] [Assigned] (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:all-tabpanel ]
Sergey Grebnov reassigned CB-2845:
----------------------------------
Assignee: Sergey Grebnov
> 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