mirror of
https://github.com/matrix-construct/construct
synced 2024-10-02 21:59:02 +02:00
ircd::js: Function to get JSFunction arity.
This commit is contained in:
parent
1dcbfb5c33
commit
fcc9cdee74
1 changed files with 7 additions and 0 deletions
|
@ -28,6 +28,7 @@ namespace js {
|
|||
string decompile(const JS::Handle<JSFunction *> &, const bool &pretty = false);
|
||||
string display_name(const JSFunction &);
|
||||
string name(const JSFunction &);
|
||||
uint16_t arity(const JSFunction &f);
|
||||
|
||||
struct function
|
||||
:JS::Rooted<JSFunction *>
|
||||
|
@ -132,6 +133,12 @@ const
|
|||
return ret;
|
||||
}
|
||||
|
||||
inline uint16_t
|
||||
arity(const JSFunction &f)
|
||||
{
|
||||
return JS_GetFunctionArity(const_cast<JSFunction *>(&f));
|
||||
}
|
||||
|
||||
inline string
|
||||
name(const JSFunction &f)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue