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