1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.DimensionError = DimensionError;
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | function DimensionError(actual, expected, relation) {
|
18 | if (!(this instanceof DimensionError)) {
|
19 | throw new SyntaxError('Constructor must be called with the new operator');
|
20 | }
|
21 |
|
22 | this.actual = actual;
|
23 | this.expected = expected;
|
24 | this.relation = relation;
|
25 | this.message = 'Dimension mismatch (' + (Array.isArray(actual) ? '[' + actual.join(', ') + ']' : actual) + ' ' + (this.relation || '!=') + ' ' + (Array.isArray(expected) ? '[' + expected.join(', ') + ']' : expected) + ')';
|
26 | this.stack = new Error().stack;
|
27 | }
|
28 |
|
29 | DimensionError.prototype = new RangeError();
|
30 | DimensionError.prototype.constructor = RangeError;
|
31 | DimensionError.prototype.name = 'DimensionError';
|
32 | DimensionError.prototype.isDimensionError = true; |
\ | No newline at end of file |