1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.ArgumentsError = ArgumentsError;
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | function ArgumentsError(fn, count, min, max) {
|
18 | if (!(this instanceof ArgumentsError)) {
|
19 | throw new SyntaxError('Constructor must be called with the new operator');
|
20 | }
|
21 |
|
22 | this.fn = fn;
|
23 | this.count = count;
|
24 | this.min = min;
|
25 | this.max = max;
|
26 | this.message = 'Wrong number of arguments in function ' + fn + ' (' + count + ' provided, ' + min + (max !== undefined && max !== null ? '-' + max : '') + ' expected)';
|
27 | this.stack = new Error().stack;
|
28 | }
|
29 |
|
30 | ArgumentsError.prototype = new Error();
|
31 | ArgumentsError.prototype.constructor = Error;
|
32 | ArgumentsError.prototype.name = 'ArgumentsError';
|
33 | ArgumentsError.prototype.isArgumentsError = true; |
\ | No newline at end of file |