Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 46 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | // RuntimeException.js |
||
2 | "use strict"; |
||
3 | |||
4 | // :: DEPENDENCIES |
||
5 | |||
6 | // load native dependencies |
||
7 | 1 | const path = require("path"); |
|
8 | |||
9 | // load local dependencies |
||
10 | 1 | const Exception = require(path.join(__dirname, "Exception.js")); |
|
11 | |||
12 | // :: BASIC SETUP |
||
13 | |||
14 | /** |
||
15 | * The <tt>RuntimeException</tt> class is the superclass of those exceptions that can be thrown during the normal operation. |
||
16 | * @param {String} name - The name of the <tt>RuntimeException</tt>. |
||
17 | * @param {String} message - The message describing the <tt>RuntimeException</tt>. |
||
18 | * @param {Number} code - The unique code that identifies the cause of the <tt>RuntimeException</tt>. |
||
19 | * @augments Exception |
||
20 | * @constructor |
||
21 | * @see https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html |
||
22 | */ |
||
23 | 1 | const RuntimeException = function (name, message, code) { |
|
24 | 6773 | Exception.call(this, name, message, code); |
|
25 | }; |
||
26 | |||
27 | // :: INHERITANCE |
||
28 | |||
29 | // set the prototype chain parent to the Exception 'class' |
||
30 | 1 | RuntimeException.prototype = Object.create(Exception.prototype); |
|
31 | |||
32 | // set the prototype chain constructor |
||
33 | 1 | RuntimeException.prototype.constructor = Exception; |
|
34 | |||
35 | // :: PROTOTYPE |
||
36 | |||
37 | /** |
||
38 | * The name used to identify a <tt>RuntimeException</tt>. |
||
39 | * @type {String} |
||
40 | * @default |
||
41 | */ |
||
42 | 1 | RuntimeException.prototype.name = "RuntimeException"; |
|
43 | |||
44 | // :: EXPORT |
||
45 | |||
46 | // export the RuntimeException 'class' |
||
47 | module.exports = RuntimeException; |