jerryscript/src/include/Jerryscript/Function.h File Reference
#include "Types.h"
Include dependency graph for jerryscript/src/include/Jerryscript/Function.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Jerryscript::CallInfo
 Maps directly onto jerry_call_info_t structure. More...
 

Namespaces

 JS
 
 Jerryscript
 

Macros

#define JS_NARG(...)   JS_NARG_I(_0 __VA_OPT__(, ) __VA_ARGS__, JS_RSEQ_N)
 
#define JS_NARG_I(...)   JS_ARG_N(__VA_ARGS__)
 
#define JS_ARG_N(_0, _1, _2, _3, _4, _5, _6, _7, _8, N, ...)   N
 
#define JS_RSEQ_N   8, 7, 6, 5, 4, 3, 2, 1, 0
 
#define JS_CONCAT_(x, y)   x##y
 
#define JS_CONCAT(x, y)   JS_CONCAT_(x, y)
 
#define JS_ARGS_0
 
#define JS_ARGS_1   JS_ARGS_0, &args[0]
 
#define JS_ARGS_2   JS_ARGS_1, &args[1]
 
#define JS_ARGS_3   JS_ARGS_2, &args[2]
 
#define JS_ARGS_4   JS_ARGS_3, &args[3]
 
#define JS_ARGS_5   JS_ARGS_4, &args[4]
 
#define JS_ARGS_6   JS_ARGS_5, &args[5]
 
#define JS_ARGS_7   JS_ARGS_6, &args[6]
 
#define JS_ARGS_8   JS_ARGS_7, &args[7]
 
Macros to implement functions callable from javascript

As with all external functions, must be registered using JS::Object::registerFunction to make available to javascript.

Function arguments should be validated, returning JS::Error object on failure.

#define JS_DEFINE_FUNCTION(func, ...)
 Argument list is fixed. More...
 
#define JS_DEFINE_FUNCTION_VAR(func)
 Arguments are passed as array. More...
 
#define JS_DECLARE_FUNCTION(func)   jerry_value_t func(const jerry_call_info_t*, const jerry_value_t[], const jerry_length_t);
 Declare a function wrapper. More...
 

Functions

jerry_value_t Jerryscript::create_arg_count_error (const char *functionName)
 

Macro Definition Documentation

◆ JS_ARG_N

#define JS_ARG_N (   _0,
  _1,
  _2,
  _3,
  _4,
  _5,
  _6,
  _7,
  _8,
  N,
  ... 
)    N

◆ JS_ARGS_0

#define JS_ARGS_0

◆ JS_ARGS_1

#define JS_ARGS_1   JS_ARGS_0, &args[0]

◆ JS_ARGS_2

#define JS_ARGS_2   JS_ARGS_1, &args[1]

◆ JS_ARGS_3

#define JS_ARGS_3   JS_ARGS_2, &args[2]

◆ JS_ARGS_4

#define JS_ARGS_4   JS_ARGS_3, &args[3]

◆ JS_ARGS_5

#define JS_ARGS_5   JS_ARGS_4, &args[4]

◆ JS_ARGS_6

#define JS_ARGS_6   JS_ARGS_5, &args[5]

◆ JS_ARGS_7

#define JS_ARGS_7   JS_ARGS_6, &args[6]

◆ JS_ARGS_8

#define JS_ARGS_8   JS_ARGS_7, &args[7]

◆ JS_CONCAT

#define JS_CONCAT (   x,
 
)    JS_CONCAT_(x, y)

◆ JS_CONCAT_

#define JS_CONCAT_ (   x,
 
)    x##y

◆ JS_NARG

#define JS_NARG (   ...)    JS_NARG_I(_0 __VA_OPT__(, ) __VA_ARGS__, JS_RSEQ_N)

◆ JS_NARG_I

#define JS_NARG_I (   ...)    JS_ARG_N(__VA_ARGS__)

◆ JS_RSEQ_N

#define JS_RSEQ_N   8, 7, 6, 5, 4, 3, 2, 1, 0