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