1 line
17 KiB
Plaintext
1 line
17 KiB
Plaintext
|
{"version":3,"file":"RuntimeError-5b082e8f.js","sources":["../../../../Source/Core/DeveloperError.js","../../../../Source/Core/Check.js","../../../../Source/Core/RuntimeError.js"],"sourcesContent":["import defined from \"./defined.js\";\n\n/**\n * Constructs an exception object that is thrown due to a developer error, e.g., invalid argument,\n * argument out of range, etc. This exception should only be thrown during development;\n * it usually indicates a bug in the calling code. This exception should never be\n * caught; instead the calling code should strive not to generate it.\n * <br /><br />\n * On the other hand, a {@link RuntimeError} indicates an exception that may\n * be thrown at runtime, e.g., out of memory, that the calling code should be prepared\n * to catch.\n *\n * @alias DeveloperError\n * @constructor\n * @extends Error\n *\n * @param {String} [message] The error message for this exception.\n *\n * @see RuntimeError\n */\nfunction DeveloperError(message) {\n /**\n * 'DeveloperError' indicating that this exception was thrown due to a developer error.\n * @type {String}\n * @readonly\n */\n this.name = \"DeveloperError\";\n\n /**\n * The explanation for why this exception was thrown.\n * @type {String}\n * @readonly\n */\n this.message = message;\n\n //Browsers such as IE don't have a stack property until you actually throw the error.\n let stack;\n try {\n throw new Error();\n } catch (e) {\n stack = e.stack;\n }\n\n /**\n * The stack trace of this exception, if available.\n * @type {String}\n * @readonly\n */\n this.stack = stack;\n}\n\nif (defined(Object.create)) {\n DeveloperError.prototype = Object.create(Error.prototype);\n DeveloperError.prototype.constructor = DeveloperError;\n}\n\nDeveloperError.prototype.toString = function () {\n let str = `${this.name}: ${this.message}`;\n\n if (defined(this.stack)) {\n str += `\\n${this.stack.toString()}`;\n }\n\n return str;\n};\n\n/**\n * @private\n */\nDeveloperError.throwInstantiationError = function () {\n throw new DeveloperError(\n \"This function defines an interface and should not be called directly.\"\n );\n};\nexport default DeveloperError;\n","import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Contains functions for checking that supplied arguments are of a specified type\n * or meet specified conditions\n * @private\n */\nconst Check = {};\n\n/**\n * Contains type checking functions, all using the typeof operator\n */\nCheck.typeOf = {};\n\nfunction getUndefinedErrorMessage(name) {\n return `${name} is required, actual value was undefined`;\n}\n\nfunction getFailedTypeErrorMessage(actual, expected, name) {\n return `Expected ${name} to be typeof ${expected}, actual typeof was ${actual}`;\n}\n\n/**\n * Throws if test is not defined\n *\n * @param {String} name The name of the variable being tested\n * @param {*} test The value that is to be checked\n * @exception {DeveloperError} test must be defined\n */\nCheck.defined = function (name, test) {\n if (!defined(test)) {\n throw new DeveloperError(getUndefinedErrorMessage(name));\n }\n};\n\n/**\n * Throws if test is not typeof 'function'\n *\n * @param {String} name The name of the variable being tested\n * @param {*} test The value to test\n * @exception {DeveloperError} test must be typeof 'function'\n */\nCheck.typeOf.func = function (name, test) {\n if (typeof test !== \"function\") {\n throw new DeveloperError(\n getFailedTypeErrorMessage(typeof test, \"function\", name)\n );\n }\n};\n\n/**\n * Throws if test is not typeof 'string'\n *\n * @param {String} name The name of the variable being tested\n * @param {*} test The value to test\n * @exception {DeveloperError} test must be typeof 'string'\n */\nCheck.typeOf.string = function (name, test) {\n if (typeof test !== \"string\") {\n throw new DeveloperError(\n getFailedTypeErrorMessage(typeof test, \"string\", name)\n );\n }\n};\n\n/**\n * Throws if test is not typeof 'number'\n *\n * @param {String} name
|