FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
mathjs/lib/error/ArgumentsError.js at master · JavaScriptIOT/mathjs · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
JavaScriptIOT
/
mathjs
Public
forked from
josdejong/mathjs
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
mathjs
/
lib
/
error
/
ArgumentsError.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (28 loc) · 1.04 KB
Breadcrumbs
mathjs
/
lib
/
error
/
ArgumentsError.js
Copy path
File metadata and controls
34 lines (28 loc) · 1.04 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'use strict'
;
/**
* Create a syntax error with the message:
* 'Wrong number of arguments in function <fn> (<count> provided, <min>-<max> expected)'
*
@param
{
string
} fn Function name
*
@param
{
number
} count Actual argument count
*
@param
{
number
} min Minimum required argument count
*
@param
{
number
} [max] Maximum required argument count
*
@extends
Error
*/
function
ArgumentsError
(
fn
,
count
,
min
,
max
)
{
if
(
!
(
this
instanceof
ArgumentsError
)
)
{
throw
new
SyntaxError
(
'Constructor must be called with the new operator'
)
;
}
this
.
fn
=
fn
;
this
.
count
=
count
;
this
.
min
=
min
;
this
.
max
=
max
;
this
.
message
=
'Wrong number of arguments in function '
+
fn
+
' ('
+
count
+
' provided, '
+
min
+
(
(
max
!=
undefined
)
?
(
'-'
+
max
)
:
''
)
+
' expected)'
;
this
.
stack
=
(
new
Error
(
)
)
.
stack
;
}
ArgumentsError
.
prototype
=
new
Error
(
)
;
ArgumentsError
.
prototype
.
constructor
=
Error
;
ArgumentsError
.
prototype
.
name
=
'ArgumentsError'
;
ArgumentsError
.
prototype
.
isArgumentsError
=
true
;
module
.
exports
=
ArgumentsError
;
Back
|
FazBrowse Home
|
New Git URL