gnss_solutions
Version:
Javascript GNSS solution analysis library
78 lines (59 loc) • 3.91 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/*
* Copyright (c) 2016 Swift Navigation Inc.
* Contact: engineering@swiftnav.com
*
* This source is subject to the license found in the file 'LICENSE' which must
* be be distributed together with this source. All other rights reserved.
*
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*/
// Common error handling definitions
/**
* Create an exception (Error) class. Takes care of boilerplate and
* ensures that stack traces will be maintained across platforms.
*
*/
var CustomException = exports.CustomException = function (_Error) {
_inherits(CustomException, _Error);
function CustomException(message) {
_classCallCheck(this, CustomException);
var _this = _possibleConstructorReturn(this, (CustomException.__proto__ || Object.getPrototypeOf(CustomException)).call(this, message));
_this.message = message;
_this.stack = new Error(message).stack;
// TODO: Use V8's native method if available, otherwise fallback
return _this;
}
_createClass(CustomException, [{
key: "toString",
value: function toString() {
return this.message;
}
}]);
return CustomException;
}(Error);
var NotImplementedException = exports.NotImplementedException = function (_CustomException) {
_inherits(NotImplementedException, _CustomException);
function NotImplementedException() {
_classCallCheck(this, NotImplementedException);
return _possibleConstructorReturn(this, (NotImplementedException.__proto__ || Object.getPrototypeOf(NotImplementedException)).call(this, "Not implemented!"));
}
return NotImplementedException;
}(CustomException);
var InvalidArgumentException = exports.InvalidArgumentException = function (_CustomException2) {
_inherits(InvalidArgumentException, _CustomException2);
function InvalidArgumentException(message) {
_classCallCheck(this, InvalidArgumentException);
return _possibleConstructorReturn(this, (InvalidArgumentException.__proto__ || Object.getPrototypeOf(InvalidArgumentException)).call(this, "Invalid argument! " + message));
}
return InvalidArgumentException;
}(CustomException);