Node.js
v8.x
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine
|
#include <node_buffer.h>
#include <node_object_wrap.h>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <vector>
#include "uv.h"
#include "node_api.h"
#include "node_internals.h"
#include "util.h"
Go to the source code of this file.
Data Structures | |
struct | napi_env__ |
class | Work |
Namespaces | |
v8impl | |
node | |
uvimpl | |
Macros | |
#define | NAPI_VERSION 1 |
#define | ENV_OBJECT_TEMPLATE(env, prefix, destination, field_count) |
#define | RETURN_STATUS_IF_FALSE(env, condition, status) |
#define | CHECK_ENV(env) |
#define | CHECK_ARG(env, arg) RETURN_STATUS_IF_FALSE((env), ((arg) != nullptr), napi_invalid_arg) |
#define | CHECK_MAYBE_EMPTY(env, maybe, status) RETURN_STATUS_IF_FALSE((env), !((maybe).IsEmpty()), (status)) |
#define | CHECK_MAYBE_NOTHING(env, maybe, status) RETURN_STATUS_IF_FALSE((env), !((maybe).IsNothing()), (status)) |
#define | NAPI_PREAMBLE(env) |
#define | CHECK_TO_TYPE(env, type, context, result, src, status) |
#define | CHECK_TO_FUNCTION(env, result, src) |
#define | CHECK_TO_OBJECT(env, context, result, src) CHECK_TO_TYPE((env), Object, (context), (result), (src), napi_object_expected) |
#define | CHECK_TO_STRING(env, context, result, src) CHECK_TO_TYPE((env), String, (context), (result), (src), napi_string_expected) |
#define | CHECK_TO_NUMBER(env, context, result, src) CHECK_TO_TYPE((env), Number, (context), (result), (src), napi_number_expected) |
#define | CHECK_TO_BOOL(env, context, result, src) |
#define | CHECK_NEW_FROM_UTF8_LEN(env, result, str, len) |
#define | CHECK_NEW_FROM_UTF8(env, result, str) CHECK_NEW_FROM_UTF8_LEN((env), (result), (str), -1) |
#define | GET_RETURN_STATUS(env) |
#define | CALL_UV(env, condition) |
Variables | |
const char * | error_messages [] |
#define CALL_UV | ( | env, | |
condition | |||
) |
Definition at line 3319 of file node_api.cc.
Referenced by napi_cancel_async_work(), and napi_queue_async_work().
#define CHECK_ARG | ( | env, | |
arg | |||
) | RETURN_STATUS_IF_FALSE((env), ((arg) != nullptr), napi_invalid_arg) |
Definition at line 76 of file node_api.cc.
Referenced by napi_adjust_external_memory(), napi_call_function(), napi_cancel_async_work(), napi_close_escapable_handle_scope(), napi_close_handle_scope(), napi_coerce_to_bool(), napi_coerce_to_number(), napi_coerce_to_object(), napi_coerce_to_string(), napi_create_array(), napi_create_array_with_length(), napi_create_arraybuffer(), napi_create_async_work(), napi_create_buffer(), napi_create_buffer_copy(), napi_create_dataview(), napi_create_double(), napi_create_error(), napi_create_external(), napi_create_external_arraybuffer(), napi_create_external_buffer(), napi_create_function(), napi_create_int32(), napi_create_int64(), napi_create_object(), napi_create_promise(), napi_create_range_error(), napi_create_reference(), napi_create_string_latin1(), napi_create_string_utf16(), napi_create_string_utf8(), napi_create_symbol(), napi_create_type_error(), napi_create_typedarray(), napi_create_uint32(), napi_define_class(), napi_define_properties(), napi_delete_async_work(), napi_delete_property(), napi_delete_reference(), napi_escape_handle(), napi_get_and_clear_last_exception(), napi_get_array_length(), napi_get_arraybuffer_info(), napi_get_boolean(), napi_get_buffer_info(), napi_get_cb_info(), napi_get_dataview_info(), napi_get_element(), napi_get_global(), napi_get_last_error_info(), napi_get_named_property(), napi_get_node_version(), napi_get_null(), napi_get_property(), napi_get_property_names(), napi_get_prototype(), napi_get_reference_value(), napi_get_typedarray_info(), napi_get_undefined(), napi_get_value_bool(), napi_get_value_double(), napi_get_value_external(), napi_get_value_int32(), napi_get_value_int64(), napi_get_value_string_latin1(), napi_get_value_string_utf16(), napi_get_value_string_utf8(), napi_get_value_uint32(), napi_get_version(), napi_has_element(), napi_has_named_property(), napi_has_own_property(), napi_has_property(), napi_instanceof(), napi_is_array(), napi_is_arraybuffer(), napi_is_buffer(), napi_is_construct_call(), napi_is_dataview(), napi_is_error(), napi_is_exception_pending(), napi_is_promise(), napi_is_typedarray(), napi_make_callback(), napi_new_instance(), napi_open_escapable_handle_scope(), napi_open_handle_scope(), napi_queue_async_work(), napi_reference_ref(), napi_reference_unref(), napi_run_script(), napi_set_element(), napi_set_named_property(), napi_set_property(), napi_strict_equals(), napi_throw(), napi_typeof(), and napi_wrap().
#define CHECK_ENV | ( | env | ) |
Definition at line 71 of file node_api.cc.
Referenced by napi_adjust_external_memory(), napi_cancel_async_work(), napi_close_escapable_handle_scope(), napi_close_handle_scope(), napi_create_array(), napi_create_array_with_length(), napi_create_async_work(), napi_create_double(), napi_create_error(), napi_create_int32(), napi_create_int64(), napi_create_object(), napi_create_range_error(), napi_create_reference(), napi_create_string_latin1(), napi_create_string_utf16(), napi_create_string_utf8(), napi_create_symbol(), napi_create_type_error(), napi_create_uint32(), napi_delete_async_work(), napi_delete_reference(), napi_escape_handle(), napi_get_and_clear_last_exception(), napi_get_arraybuffer_info(), napi_get_boolean(), napi_get_buffer_info(), napi_get_cb_info(), napi_get_dataview_info(), napi_get_global(), napi_get_last_error_info(), napi_get_node_version(), napi_get_null(), napi_get_reference_value(), napi_get_typedarray_info(), napi_get_undefined(), napi_get_value_bool(), napi_get_value_double(), napi_get_value_external(), napi_get_value_int32(), napi_get_value_int64(), napi_get_value_string_latin1(), napi_get_value_string_utf16(), napi_get_value_string_utf8(), napi_get_value_uint32(), napi_get_version(), napi_is_array(), napi_is_arraybuffer(), napi_is_buffer(), napi_is_construct_call(), napi_is_dataview(), napi_is_error(), napi_is_exception_pending(), napi_is_promise(), napi_is_typedarray(), napi_open_escapable_handle_scope(), napi_open_handle_scope(), napi_queue_async_work(), napi_reference_ref(), napi_reference_unref(), napi_typeof(), and napi_unwrap().
#define CHECK_MAYBE_EMPTY | ( | env, | |
maybe, | |||
status | |||
) | RETURN_STATUS_IF_FALSE((env), !((maybe).IsEmpty()), (status)) |
Definition at line 79 of file node_api.cc.
Referenced by napi_create_buffer(), napi_create_buffer_copy(), napi_create_external_buffer(), napi_create_function(), napi_create_promise(), napi_create_string_latin1(), napi_create_string_utf16(), napi_get_element(), napi_get_named_property(), napi_get_property(), napi_get_property_names(), napi_new_instance(), and napi_wrap().
#define CHECK_MAYBE_NOTHING | ( | env, | |
maybe, | |||
status | |||
) | RETURN_STATUS_IF_FALSE((env), !((maybe).IsNothing()), (status)) |
Definition at line 82 of file node_api.cc.
Referenced by napi_delete_element(), napi_delete_property(), napi_has_element(), napi_has_named_property(), napi_has_own_property(), and napi_has_property().
#define CHECK_NEW_FROM_UTF8 | ( | env, | |
result, | |||
str | |||
) | CHECK_NEW_FROM_UTF8_LEN((env), (result), (str), -1) |
Definition at line 130 of file node_api.cc.
Referenced by napi_create_function(), napi_define_class(), napi_get_named_property(), napi_has_named_property(), napi_set_named_property(), napi_throw_error(), napi_throw_range_error(), and napi_throw_type_error().
#define CHECK_NEW_FROM_UTF8_LEN | ( | env, | |
result, | |||
str, | |||
len | |||
) |
Definition at line 122 of file node_api.cc.
Referenced by napi_create_string_utf8().
#define CHECK_TO_BOOL | ( | env, | |
context, | |||
result, | |||
src | |||
) |
Definition at line 118 of file node_api.cc.
Referenced by napi_coerce_to_bool().
#define CHECK_TO_FUNCTION | ( | env, | |
result, | |||
src | |||
) |
Definition at line 101 of file node_api.cc.
Referenced by napi_call_function(), napi_make_callback(), and napi_new_instance().
#define CHECK_TO_NUMBER | ( | env, | |
context, | |||
result, | |||
src | |||
) | CHECK_TO_TYPE((env), Number, (context), (result), (src), napi_number_expected) |
Definition at line 115 of file node_api.cc.
Referenced by napi_coerce_to_number().
#define CHECK_TO_OBJECT | ( | env, | |
context, | |||
result, | |||
src | |||
) | CHECK_TO_TYPE((env), Object, (context), (result), (src), napi_object_expected) |
Definition at line 109 of file node_api.cc.
Referenced by napi_coerce_to_object(), napi_define_properties(), napi_delete_element(), napi_delete_property(), napi_get_element(), napi_get_named_property(), napi_get_property(), napi_get_property_names(), napi_get_prototype(), napi_has_element(), napi_has_named_property(), napi_has_own_property(), napi_has_property(), napi_instanceof(), napi_make_callback(), napi_set_element(), napi_set_named_property(), and napi_set_property().
#define CHECK_TO_STRING | ( | env, | |
context, | |||
result, | |||
src | |||
) | CHECK_TO_TYPE((env), String, (context), (result), (src), napi_string_expected) |
Definition at line 112 of file node_api.cc.
Referenced by napi_coerce_to_string().
#define CHECK_TO_TYPE | ( | env, | |
type, | |||
context, | |||
result, | |||
src, | |||
status | |||
) |
Definition at line 93 of file node_api.cc.
#define ENV_OBJECT_TEMPLATE | ( | env, | |
prefix, | |||
destination, | |||
field_count | |||
) |
Definition at line 51 of file node_api.cc.
Referenced by napi_wrap().
#define GET_RETURN_STATUS | ( | env | ) |
Definition at line 133 of file node_api.cc.
Referenced by napi_coerce_to_bool(), napi_coerce_to_number(), napi_coerce_to_object(), napi_coerce_to_string(), napi_create_arraybuffer(), napi_create_buffer(), napi_create_buffer_copy(), napi_create_dataview(), napi_create_external_arraybuffer(), napi_create_external_buffer(), napi_create_function(), napi_create_promise(), napi_delete_element(), napi_delete_property(), napi_get_array_length(), napi_get_element(), napi_get_named_property(), napi_get_property(), napi_get_property_names(), napi_get_prototype(), napi_has_element(), napi_has_named_property(), napi_has_own_property(), napi_has_property(), napi_make_callback(), napi_new_instance(), napi_set_element(), napi_set_named_property(), napi_set_property(), napi_strict_equals(), and napi_wrap().
#define NAPI_PREAMBLE | ( | env | ) |
Definition at line 86 of file node_api.cc.
Referenced by napi_call_function(), napi_coerce_to_bool(), napi_coerce_to_number(), napi_coerce_to_object(), napi_coerce_to_string(), napi_create_arraybuffer(), napi_create_buffer(), napi_create_buffer_copy(), napi_create_dataview(), napi_create_external(), napi_create_external_arraybuffer(), napi_create_external_buffer(), napi_create_function(), napi_create_promise(), napi_create_typedarray(), napi_define_class(), napi_define_properties(), napi_delete_element(), napi_delete_property(), napi_get_array_length(), napi_get_element(), napi_get_named_property(), napi_get_property(), napi_get_property_names(), napi_get_prototype(), napi_has_element(), napi_has_named_property(), napi_has_own_property(), napi_has_property(), napi_instanceof(), napi_make_callback(), napi_new_instance(), napi_remove_wrap(), napi_run_script(), napi_set_element(), napi_set_named_property(), napi_set_property(), napi_strict_equals(), napi_throw(), napi_throw_error(), napi_throw_range_error(), napi_throw_type_error(), and napi_wrap().
#define NAPI_VERSION 1 |
Definition at line 22 of file node_api.cc.
Referenced by napi_get_version().
#define RETURN_STATUS_IF_FALSE | ( | env, | |
condition, | |||
status | |||
) |
Definition at line 64 of file node_api.cc.
Referenced by napi_create_dataview(), napi_create_error(), napi_create_function(), napi_create_range_error(), napi_create_symbol(), napi_create_type_error(), napi_create_typedarray(), napi_define_class(), napi_get_array_length(), napi_get_arraybuffer_info(), napi_get_dataview_info(), napi_get_typedarray_info(), napi_get_value_bool(), napi_get_value_double(), napi_get_value_external(), napi_get_value_int32(), napi_get_value_string_latin1(), napi_get_value_string_utf16(), napi_get_value_string_utf8(), napi_get_value_uint32(), napi_has_own_property(), napi_set_element(), napi_set_named_property(), napi_set_property(), and napi_wrap().
napi_status napi_adjust_external_memory | ( | napi_env | env, |
int64_t | change_in_bytes, | ||
int64_t * | adjusted_value | ||
) |
Definition at line 3216 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, and napi_env__::isolate.
napi_status napi_call_function | ( | napi_env | env, |
napi_value | recv, | ||
napi_value | func, | ||
size_t | argc, | ||
const napi_value * | argv, | ||
napi_value * | result | ||
) |
Definition at line 1892 of file node_api.cc.
References CHECK_ARG, CHECK_TO_FUNCTION, napi_env__::isolate, and NAPI_PREAMBLE.
napi_status napi_cancel_async_work | ( | napi_env | env, |
napi_async_work | work | ||
) |
Definition at line 3373 of file node_api.cc.
References CALL_UV, CHECK_ARG, CHECK_ENV, and Work::Request().
napi_status napi_close_escapable_handle_scope | ( | napi_env | env, |
napi_escapable_handle_scope | scope | ||
) |
Definition at line 2579 of file node_api.cc.
napi_status napi_close_handle_scope | ( | napi_env | env, |
napi_handle_scope | scope | ||
) |
Definition at line 2556 of file node_api.cc.
napi_status napi_coerce_to_bool | ( | napi_env | env, |
napi_value | value, | ||
napi_value * | result | ||
) |
Definition at line 2260 of file node_api.cc.
References CHECK_ARG, CHECK_TO_BOOL, GET_RETURN_STATUS, napi_env__::isolate, and NAPI_PREAMBLE.
napi_status napi_coerce_to_number | ( | napi_env | env, |
napi_value | value, | ||
napi_value * | result | ||
) |
Definition at line 2277 of file node_api.cc.
References CHECK_ARG, CHECK_TO_NUMBER, GET_RETURN_STATUS, napi_env__::isolate, and NAPI_PREAMBLE.
napi_status napi_coerce_to_object | ( | napi_env | env, |
napi_value | value, | ||
napi_value * | result | ||
) |
Definition at line 2244 of file node_api.cc.
References CHECK_ARG, CHECK_TO_OBJECT, GET_RETURN_STATUS, napi_env__::isolate, and NAPI_PREAMBLE.
napi_status napi_coerce_to_string | ( | napi_env | env, |
napi_value | value, | ||
napi_value * | result | ||
) |
Definition at line 2294 of file node_api.cc.
References CHECK_ARG, CHECK_TO_STRING, GET_RETURN_STATUS, napi_env__::isolate, and NAPI_PREAMBLE.
napi_status napi_create_array | ( | napi_env | env, |
napi_value * | result | ||
) |
Definition at line 1510 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_env__::isolate, and node::Buffer::New().
napi_status napi_create_array_with_length | ( | napi_env | env, |
size_t | length, | ||
napi_value * | result | ||
) |
Definition at line 1520 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_env__::isolate, and node::Buffer::New().
napi_status napi_create_arraybuffer | ( | napi_env | env, |
size_t | byte_length, | ||
void ** | data, | ||
napi_value * | result | ||
) |
Definition at line 2934 of file node_api.cc.
References CHECK_ARG, GET_RETURN_STATUS, napi_env__::isolate, NAPI_PREAMBLE, and node::Buffer::New().
napi_status napi_create_async_work | ( | napi_env | env, |
napi_async_execute_callback | execute, | ||
napi_async_complete_callback | complete, | ||
void * | data, | ||
napi_async_work * | result | ||
) |
Definition at line 3328 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, and Work::New().
napi_status napi_create_buffer | ( | napi_env | env, |
size_t | length, | ||
void ** | data, | ||
napi_value * | result | ||
) |
Definition at line 2819 of file node_api.cc.
References CHECK_ARG, CHECK_MAYBE_EMPTY, node::Buffer::Data(), GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, NAPI_PREAMBLE, and node::Buffer::New().
napi_status napi_create_buffer_copy | ( | napi_env | env, |
size_t | length, | ||
const void * | data, | ||
void ** | result_data, | ||
napi_value * | result | ||
) |
Definition at line 2872 of file node_api.cc.
References CHECK_ARG, CHECK_MAYBE_EMPTY, node::Buffer::Copy(), node::Buffer::Data(), GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, and NAPI_PREAMBLE.
napi_status napi_create_dataview | ( | napi_env | env, |
size_t | byte_length, | ||
napi_value | arraybuffer, | ||
size_t | byte_offset, | ||
napi_value * | result | ||
) |
Definition at line 3129 of file node_api.cc.
References CHECK_ARG, GET_RETURN_STATUS, napi_invalid_arg, NAPI_PREAMBLE, node::Buffer::New(), and RETURN_STATUS_IF_FALSE.
napi_status napi_create_double | ( | napi_env | env, |
double | value, | ||
napi_value * | result | ||
) |
Definition at line 1584 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_env__::isolate, and node::Buffer::New().
napi_status napi_create_error | ( | napi_env | env, |
napi_value | code, | ||
napi_value | msg, | ||
napi_value * | result | ||
) |
Definition at line 1721 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_string_expected, RETURN_STATUS_IF_FALSE, and status.
napi_status napi_create_external | ( | napi_env | env, |
void * | data, | ||
napi_finalize | finalize_cb, | ||
void * | finalize_hint, | ||
napi_value * | result | ||
) |
Definition at line 2407 of file node_api.cc.
References CHECK_ARG, napi_env__::isolate, NAPI_PREAMBLE, and node::Buffer::New().
napi_status napi_create_external_arraybuffer | ( | napi_env | env, |
void * | external_data, | ||
size_t | byte_length, | ||
napi_finalize | finalize_cb, | ||
void * | finalize_hint, | ||
napi_value * | result | ||
) |
Definition at line 2955 of file node_api.cc.
References CHECK_ARG, GET_RETURN_STATUS, napi_env__::isolate, NAPI_PREAMBLE, and node::Buffer::New().
napi_status napi_create_external_buffer | ( | napi_env | env, |
size_t | length, | ||
void * | data, | ||
napi_finalize | finalize_cb, | ||
void * | finalize_hint, | ||
napi_value * | result | ||
) |
Definition at line 2841 of file node_api.cc.
References CHECK_ARG, CHECK_MAYBE_EMPTY, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, NAPI_PREAMBLE, and node::Buffer::New().
napi_status napi_create_function | ( | napi_env | env, |
const char * | utf8name, | ||
napi_callback | cb, | ||
void * | callback_data, | ||
napi_value * | result | ||
) |
Definition at line 932 of file node_api.cc.
References CHECK_ARG, CHECK_MAYBE_EMPTY, CHECK_NEW_FROM_UTF8, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, NAPI_PREAMBLE, node::Buffer::New(), and RETURN_STATUS_IF_FALSE.
napi_status napi_create_int32 | ( | napi_env | env, |
int32_t | value, | ||
napi_value * | result | ||
) |
Definition at line 1596 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_env__::isolate, and node::Buffer::New().
napi_status napi_create_int64 | ( | napi_env | env, |
int64_t | value, | ||
napi_value * | result | ||
) |
Definition at line 1620 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_env__::isolate, and node::Buffer::New().
napi_status napi_create_object | ( | napi_env | env, |
napi_value * | result | ||
) |
Definition at line 1500 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_env__::isolate, and node::Buffer::New().
NAPI_EXTERN napi_status napi_create_promise | ( | napi_env | env, |
napi_deferred * | deferred, | ||
napi_value * | promise | ||
) |
Definition at line 3384 of file node_api.cc.
References CHECK_ARG, CHECK_MAYBE_EMPTY, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, NAPI_PREAMBLE, and node::Buffer::New().
napi_status napi_create_range_error | ( | napi_env | env, |
napi_value | code, | ||
napi_value | msg, | ||
napi_value * | result | ||
) |
Definition at line 1763 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_string_expected, RETURN_STATUS_IF_FALSE, and status.
napi_status napi_create_reference | ( | napi_env | env, |
napi_value | value, | ||
uint32_t | initial_refcount, | ||
napi_ref * | result | ||
) |
Definition at line 2451 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, and node::Buffer::New().
napi_status napi_create_string_latin1 | ( | napi_env | env, |
const char * | str, | ||
size_t | length, | ||
napi_value * | result | ||
) |
Definition at line 1532 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, CHECK_MAYBE_EMPTY, napi_env__::isolate, and napi_generic_failure.
napi_status napi_create_string_utf16 | ( | napi_env | env, |
const char16_t * | str, | ||
size_t | length, | ||
napi_value * | result | ||
) |
Definition at line 1565 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, CHECK_MAYBE_EMPTY, napi_env__::isolate, and napi_generic_failure.
napi_status napi_create_string_utf8 | ( | napi_env | env, |
const char * | str, | ||
size_t | length, | ||
napi_value * | result | ||
) |
Definition at line 1551 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, CHECK_NEW_FROM_UTF8_LEN, and s.
napi_status napi_create_symbol | ( | napi_env | env, |
napi_value | description, | ||
napi_value * | result | ||
) |
Definition at line 1647 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_env__::isolate, napi_string_expected, node::Buffer::New(), and RETURN_STATUS_IF_FALSE.
napi_status napi_create_type_error | ( | napi_env | env, |
napi_value | code, | ||
napi_value | msg, | ||
napi_value * | result | ||
) |
Definition at line 1742 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_string_expected, RETURN_STATUS_IF_FALSE, and status.
napi_status napi_create_typedarray | ( | napi_env | env, |
napi_typedarray_type | type, | ||
size_t | length, | ||
napi_value | arraybuffer, | ||
size_t | byte_offset, | ||
napi_value * | result | ||
) |
Definition at line 3019 of file node_api.cc.
References CHECK_ARG, napi_float32_array, napi_float64_array, napi_int16_array, napi_int32_array, napi_int8_array, napi_invalid_arg, NAPI_PREAMBLE, napi_uint16_array, napi_uint32_array, napi_uint8_array, napi_uint8_clamped_array, node::Buffer::New(), and RETURN_STATUS_IF_FALSE.
napi_status napi_create_uint32 | ( | napi_env | env, |
uint32_t | value, | ||
napi_value * | result | ||
) |
Definition at line 1608 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, and napi_env__::isolate.
napi_status napi_define_class | ( | napi_env | env, |
const char * | utf8name, | ||
napi_callback | constructor, | ||
void * | callback_data, | ||
size_t | property_count, | ||
const napi_property_descriptor * | properties, | ||
napi_value * | result | ||
) |
Definition at line 969 of file node_api.cc.
References napi_property_descriptor::attributes, CHECK_ARG, CHECK_NEW_FROM_UTF8, napi_env__::isolate, napi_generic_failure, napi_ok, NAPI_PREAMBLE, napi_static, node::Buffer::New(), p, RETURN_STATUS_IF_FALSE, and status.
napi_status napi_define_properties | ( | napi_env | env, |
napi_value | object, | ||
size_t | property_count, | ||
const napi_property_descriptor * | properties | ||
) |
Definition at line 1362 of file node_api.cc.
References CHECK_ARG, CHECK_TO_OBJECT, napi_env__::isolate, napi_ok, NAPI_PREAMBLE, p, and status.
napi_status napi_delete_async_work | ( | napi_env | env, |
napi_async_work | work | ||
) |
Definition at line 3344 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, and Work::Delete().
napi_status napi_delete_element | ( | napi_env | env, |
napi_value | object, | ||
uint32_t | index, | ||
bool * | result | ||
) |
Definition at line 1342 of file node_api.cc.
References CHECK_MAYBE_NOTHING, CHECK_TO_OBJECT, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, and NAPI_PREAMBLE.
napi_status napi_delete_property | ( | napi_env | env, |
napi_value | object, | ||
napi_value | key, | ||
bool * | result | ||
) |
Definition at line 1162 of file node_api.cc.
References CHECK_ARG, CHECK_MAYBE_NOTHING, CHECK_TO_OBJECT, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, and NAPI_PREAMBLE.
napi_status napi_delete_reference | ( | napi_env | env, |
napi_ref | ref | ||
) |
Definition at line 2470 of file node_api.cc.
napi_status napi_escape_handle | ( | napi_env | env, |
napi_escapable_handle_scope | scope, | ||
napi_value | escapee, | ||
napi_value * | result | ||
) |
Definition at line 2591 of file node_api.cc.
NAPI_NO_RETURN void napi_fatal_error | ( | const char * | location, |
const char * | message | ||
) |
Definition at line 927 of file node_api.cc.
References node::FatalError().
napi_status napi_get_and_clear_last_exception | ( | napi_env | env, |
napi_value * | result | ||
) |
Definition at line 2801 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_env__::isolate, napi_env__::last_exception, napi_get_undefined(), and node::Buffer::New().
napi_status napi_get_array_length | ( | napi_env | env, |
napi_value | value, | ||
uint32_t * | result | ||
) |
Definition at line 1451 of file node_api.cc.
References CHECK_ARG, GET_RETURN_STATUS, napi_array_expected, NAPI_PREAMBLE, and RETURN_STATUS_IF_FALSE.
napi_status napi_get_arraybuffer_info | ( | napi_env | env, |
napi_value | arraybuffer, | ||
void ** | data, | ||
size_t * | byte_length | ||
) |
Definition at line 2984 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_invalid_arg, and RETURN_STATUS_IF_FALSE.
napi_status napi_get_boolean | ( | napi_env | env, |
bool | value, | ||
napi_value * | result | ||
) |
Definition at line 1632 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, and napi_env__::isolate.
napi_status napi_get_buffer_info | ( | napi_env | env, |
napi_value | value, | ||
void ** | data, | ||
size_t * | length | ||
) |
Definition at line 2904 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, node::Buffer::Data(), and node::Buffer::Length().
napi_status napi_get_cb_info | ( | napi_env | env, |
napi_callback_info | cbinfo, | ||
size_t * | argc, | ||
napi_value * | argv, | ||
napi_value * | this_arg, | ||
void ** | data | ||
) |
Definition at line 1846 of file node_api.cc.
napi_status napi_get_dataview_info | ( | napi_env | env, |
napi_value | dataview, | ||
size_t * | byte_length, | ||
void ** | data, | ||
napi_value * | arraybuffer, | ||
size_t * | byte_offset | ||
) |
Definition at line 3160 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_invalid_arg, and RETURN_STATUS_IF_FALSE.
napi_status napi_get_element | ( | napi_env | env, |
napi_value | object, | ||
uint32_t | index, | ||
napi_value * | result | ||
) |
Definition at line 1321 of file node_api.cc.
References CHECK_ARG, CHECK_MAYBE_EMPTY, CHECK_TO_OBJECT, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, and NAPI_PREAMBLE.
napi_status napi_get_global | ( | napi_env | env, |
napi_value * | result | ||
) |
Definition at line 1926 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, and napi_env__::isolate.
napi_status napi_get_last_error_info | ( | napi_env | env, |
const napi_extended_error_info ** | result | ||
) |
Definition at line 904 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_extended_error_info::error_code, napi_extended_error_info::error_message, error_messages, napi_env__::last_error, napi_escape_called_twice, and napi_ok.
napi_status napi_get_named_property | ( | napi_env | env, |
napi_value | object, | ||
const char * | utf8name, | ||
napi_value * | result | ||
) |
Definition at line 1253 of file node_api.cc.
References CHECK_ARG, CHECK_MAYBE_EMPTY, CHECK_NEW_FROM_UTF8, CHECK_TO_OBJECT, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, and NAPI_PREAMBLE.
napi_status napi_get_node_version | ( | napi_env | env, |
const napi_node_version ** | result | ||
) |
Definition at line 3202 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, NODE_MAJOR_VERSION, NODE_MINOR_VERSION, NODE_PATCH_VERSION, and NODE_RELEASE.
napi_status napi_get_null | ( | napi_env | env, |
napi_value * | result | ||
) |
Definition at line 1835 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, and napi_env__::isolate.
napi_status napi_get_property | ( | napi_env | env, |
napi_value | object, | ||
napi_value | key, | ||
napi_value * | result | ||
) |
Definition at line 1138 of file node_api.cc.
References CHECK_ARG, CHECK_MAYBE_EMPTY, CHECK_TO_OBJECT, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, and NAPI_PREAMBLE.
napi_status napi_get_property_names | ( | napi_env | env, |
napi_value | object, | ||
napi_value * | result | ||
) |
Definition at line 1072 of file node_api.cc.
References CHECK_ARG, CHECK_MAYBE_EMPTY, CHECK_TO_OBJECT, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, and NAPI_PREAMBLE.
napi_status napi_get_prototype | ( | napi_env | env, |
napi_value | object, | ||
napi_value * | result | ||
) |
Definition at line 1483 of file node_api.cc.
References CHECK_ARG, CHECK_TO_OBJECT, GET_RETURN_STATUS, napi_env__::isolate, and NAPI_PREAMBLE.
napi_status napi_get_reference_value | ( | napi_env | env, |
napi_ref | ref, | ||
napi_value * | result | ||
) |
Definition at line 2530 of file node_api.cc.
napi_status napi_get_typedarray_info | ( | napi_env | env, |
napi_value | typedarray, | ||
napi_typedarray_type * | type, | ||
size_t * | length, | ||
void ** | data, | ||
napi_value * | arraybuffer, | ||
size_t * | byte_offset | ||
) |
Definition at line 3071 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_float32_array, napi_float64_array, napi_int16_array, napi_int32_array, napi_int8_array, napi_invalid_arg, napi_uint16_array, napi_uint32_array, napi_uint8_array, napi_uint8_clamped_array, and RETURN_STATUS_IF_FALSE.
napi_status napi_get_undefined | ( | napi_env | env, |
napi_value * | result | ||
) |
Definition at line 1825 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, and napi_env__::isolate.
Referenced by napi_get_and_clear_last_exception().
napi_status napi_get_value_bool | ( | napi_env | env, |
napi_value | value, | ||
bool * | result | ||
) |
Definition at line 2120 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_boolean_expected, and RETURN_STATUS_IF_FALSE.
napi_status napi_get_value_double | ( | napi_env | env, |
napi_value | value, | ||
double * | result | ||
) |
Definition at line 2022 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_number_expected, and RETURN_STATUS_IF_FALSE.
napi_status napi_get_value_external | ( | napi_env | env, |
napi_value | value, | ||
void ** | result | ||
) |
Definition at line 2434 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_invalid_arg, and RETURN_STATUS_IF_FALSE.
napi_status napi_get_value_int32 | ( | napi_env | env, |
napi_value | value, | ||
int32_t * | result | ||
) |
Definition at line 2039 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_number_expected, and RETURN_STATUS_IF_FALSE.
napi_status napi_get_value_int64 | ( | napi_env | env, |
napi_value | value, | ||
int64_t * | result | ||
) |
Definition at line 2087 of file node_api.cc.
napi_status napi_get_value_string_latin1 | ( | napi_env | env, |
napi_value | value, | ||
char * | buf, | ||
size_t | bufsize, | ||
size_t * | result | ||
) |
Definition at line 2143 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, node::Buffer::Length(), napi_string_expected, and RETURN_STATUS_IF_FALSE.
napi_status napi_get_value_string_utf16 | ( | napi_env | env, |
napi_value | value, | ||
char16_t * | buf, | ||
size_t | bufsize, | ||
size_t * | result | ||
) |
Definition at line 2215 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, node::Buffer::Length(), napi_string_expected, and RETURN_STATUS_IF_FALSE.
napi_status napi_get_value_string_utf8 | ( | napi_env | env, |
napi_value | value, | ||
char * | buf, | ||
size_t | bufsize, | ||
size_t * | result | ||
) |
Definition at line 2179 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_string_expected, and RETURN_STATUS_IF_FALSE.
napi_status napi_get_value_uint32 | ( | napi_env | env, |
napi_value | value, | ||
uint32_t * | result | ||
) |
Definition at line 2063 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_number_expected, and RETURN_STATUS_IF_FALSE.
napi_status napi_get_version | ( | napi_env | env, |
uint32_t * | result | ||
) |
Definition at line 3195 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, and NAPI_VERSION.
napi_status napi_has_element | ( | napi_env | env, |
napi_value | object, | ||
uint32_t | index, | ||
bool * | result | ||
) |
Definition at line 1300 of file node_api.cc.
References CHECK_ARG, CHECK_MAYBE_NOTHING, CHECK_TO_OBJECT, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, and NAPI_PREAMBLE.
napi_status napi_has_named_property | ( | napi_env | env, |
napi_value | object, | ||
const char * | utf8name, | ||
bool * | result | ||
) |
Definition at line 1229 of file node_api.cc.
References CHECK_ARG, CHECK_MAYBE_NOTHING, CHECK_NEW_FROM_UTF8, CHECK_TO_OBJECT, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, and NAPI_PREAMBLE.
NAPI_EXTERN napi_status napi_has_own_property | ( | napi_env | env, |
napi_value | object, | ||
napi_value | key, | ||
bool * | result | ||
) |
Definition at line 1184 of file node_api.cc.
References CHECK_ARG, CHECK_MAYBE_NOTHING, CHECK_TO_OBJECT, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, napi_name_expected, NAPI_PREAMBLE, and RETURN_STATUS_IF_FALSE.
napi_status napi_has_property | ( | napi_env | env, |
napi_value | object, | ||
napi_value | key, | ||
bool * | result | ||
) |
Definition at line 1115 of file node_api.cc.
References CHECK_ARG, CHECK_MAYBE_NOTHING, CHECK_TO_OBJECT, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, and NAPI_PREAMBLE.
napi_status napi_instanceof | ( | napi_env | env, |
napi_value | object, | ||
napi_value | constructor, | ||
bool * | result | ||
) |
Definition at line 2639 of file node_api.cc.
References CHECK_ARG, CHECK_TO_OBJECT, napi_env__::isolate, NAPI_PREAMBLE, and napi_throw_type_error().
napi_status napi_is_array | ( | napi_env | env, |
napi_value | value, | ||
bool * | result | ||
) |
Definition at line 1440 of file node_api.cc.
napi_status napi_is_arraybuffer | ( | napi_env | env, |
napi_value | value, | ||
bool * | result | ||
) |
Definition at line 2923 of file node_api.cc.
napi_status napi_is_buffer | ( | napi_env | env, |
napi_value | value, | ||
bool * | result | ||
) |
Definition at line 2895 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, and node::Buffer::HasInstance().
napi_status napi_is_construct_call | ( | napi_env | env, |
napi_callback_info | cbinfo, | ||
bool * | result | ||
) |
Definition at line 1877 of file node_api.cc.
napi_status napi_is_dataview | ( | napi_env | env, |
napi_value | value, | ||
bool * | result | ||
) |
Definition at line 3149 of file node_api.cc.
napi_status napi_is_error | ( | napi_env | env, |
napi_value | value, | ||
bool * | result | ||
) |
Definition at line 2009 of file node_api.cc.
napi_status napi_is_exception_pending | ( | napi_env | env, |
bool * | result | ||
) |
Definition at line 2791 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, and napi_env__::last_exception.
NAPI_EXTERN napi_status napi_is_promise | ( | napi_env | env, |
napi_value | promise, | ||
bool * | is_promise | ||
) |
Definition at line 3415 of file node_api.cc.
napi_status napi_is_typedarray | ( | napi_env | env, |
napi_value | value, | ||
bool * | result | ||
) |
Definition at line 3008 of file node_api.cc.
napi_status napi_make_callback | ( | napi_env | env, |
napi_value | recv, | ||
napi_value | func, | ||
size_t | argc, | ||
const napi_value * | argv, | ||
napi_value * | result | ||
) |
Definition at line 2758 of file node_api.cc.
References CHECK_ARG, CHECK_TO_FUNCTION, CHECK_TO_OBJECT, GET_RETURN_STATUS, napi_env__::isolate, node::MakeCallback(), and NAPI_PREAMBLE.
void napi_module_register | ( | napi_module * | mod | ) |
Definition at line 844 of file node_api.cc.
References node::load_napi_modules, napi_module::nm_filename, napi_module::nm_flags, napi_module::nm_modname, node::node_module_register(), and NODE_MODULE_VERSION.
napi_status napi_new_instance | ( | napi_env | env, |
napi_value | constructor, | ||
size_t | argc, | ||
const napi_value * | argv, | ||
napi_value * | result | ||
) |
Definition at line 2612 of file node_api.cc.
References CHECK_ARG, CHECK_MAYBE_EMPTY, CHECK_TO_FUNCTION, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, and NAPI_PREAMBLE.
napi_status napi_open_escapable_handle_scope | ( | napi_env | env, |
napi_escapable_handle_scope * | result | ||
) |
Definition at line 2566 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, and napi_env__::isolate.
napi_status napi_open_handle_scope | ( | napi_env | env, |
napi_handle_scope * | result | ||
) |
Definition at line 2545 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, and napi_env__::isolate.
napi_status napi_queue_async_work | ( | napi_env | env, |
napi_async_work | work | ||
) |
Definition at line 3353 of file node_api.cc.
References CALL_UV, CHECK_ARG, CHECK_ENV, Work::CompleteCallback(), Work::ExecuteCallback(), and Work::Request().
napi_status napi_reference_ref | ( | napi_env | env, |
napi_ref | ref, | ||
uint32_t * | result | ||
) |
Definition at line 2486 of file node_api.cc.
napi_status napi_reference_unref | ( | napi_env | env, |
napi_ref | ref, | ||
uint32_t * | result | ||
) |
Definition at line 2506 of file node_api.cc.
NAPI_EXTERN napi_status napi_reject_deferred | ( | napi_env | env, |
napi_deferred | deferred, | ||
napi_value | resolution | ||
) |
Definition at line 3409 of file node_api.cc.
napi_status napi_remove_wrap | ( | napi_env | env, |
napi_value | obj, | ||
void ** | result | ||
) |
Definition at line 2380 of file node_api.cc.
References napi_ok, NAPI_PREAMBLE, and status.
NAPI_EXTERN napi_status napi_resolve_deferred | ( | napi_env | env, |
napi_deferred | deferred, | ||
napi_value | resolution | ||
) |
Definition at line 3403 of file node_api.cc.
NAPI_EXTERN napi_status napi_run_script | ( | napi_env | env, |
napi_value | script, | ||
napi_value * | result | ||
) |
Definition at line 3427 of file node_api.cc.
References CHECK_ARG, and NAPI_PREAMBLE.
napi_status napi_set_element | ( | napi_env | env, |
napi_value | object, | ||
uint32_t | index, | ||
napi_value | value | ||
) |
Definition at line 1279 of file node_api.cc.
References CHECK_ARG, CHECK_TO_OBJECT, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, NAPI_PREAMBLE, and RETURN_STATUS_IF_FALSE.
napi_status napi_set_named_property | ( | napi_env | env, |
napi_value | object, | ||
const char * | utf8name, | ||
napi_value | value | ||
) |
Definition at line 1205 of file node_api.cc.
References CHECK_ARG, CHECK_NEW_FROM_UTF8, CHECK_TO_OBJECT, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, NAPI_PREAMBLE, and RETURN_STATUS_IF_FALSE.
napi_status napi_set_property | ( | napi_env | env, |
napi_value | object, | ||
napi_value | key, | ||
napi_value | value | ||
) |
Definition at line 1092 of file node_api.cc.
References CHECK_ARG, CHECK_TO_OBJECT, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, NAPI_PREAMBLE, and RETURN_STATUS_IF_FALSE.
napi_status napi_strict_equals | ( | napi_env | env, |
napi_value | lhs, | ||
napi_value | rhs, | ||
bool * | result | ||
) |
Definition at line 1467 of file node_api.cc.
References a, CHECK_ARG, GET_RETURN_STATUS, and NAPI_PREAMBLE.
napi_status napi_throw | ( | napi_env | env, |
napi_value | error | ||
) |
Definition at line 1940 of file node_api.cc.
References CHECK_ARG, napi_env__::isolate, and NAPI_PREAMBLE.
napi_status napi_throw_error | ( | napi_env | env, |
const char * | code, | ||
const char * | msg | ||
) |
Definition at line 1952 of file node_api.cc.
References CHECK_NEW_FROM_UTF8, napi_env__::isolate, NAPI_PREAMBLE, and status.
napi_status napi_throw_range_error | ( | napi_env | env, |
const char * | code, | ||
const char * | msg | ||
) |
Definition at line 1990 of file node_api.cc.
References CHECK_NEW_FROM_UTF8, napi_env__::isolate, NAPI_PREAMBLE, and status.
napi_status napi_throw_type_error | ( | napi_env | env, |
const char * | code, | ||
const char * | msg | ||
) |
Definition at line 1971 of file node_api.cc.
References CHECK_NEW_FROM_UTF8, napi_env__::isolate, NAPI_PREAMBLE, and status.
Referenced by napi_instanceof().
napi_status napi_typeof | ( | napi_env | env, |
napi_value | value, | ||
napi_valuetype * | result | ||
) |
Definition at line 1784 of file node_api.cc.
References CHECK_ARG, CHECK_ENV, napi_boolean, napi_external, napi_function, napi_null, napi_number, napi_object, napi_string, napi_symbol, and napi_undefined.
napi_status napi_unwrap | ( | napi_env | env, |
napi_value | obj, | ||
void ** | result | ||
) |
Definition at line 2372 of file node_api.cc.
References CHECK_ENV.
napi_status napi_wrap | ( | napi_env | env, |
napi_value | js_object, | ||
void * | native_object, | ||
napi_finalize | finalize_cb, | ||
void * | finalize_hint, | ||
napi_ref * | result | ||
) |
Definition at line 2311 of file node_api.cc.
References CHECK_ARG, CHECK_MAYBE_EMPTY, ENV_OBJECT_TEMPLATE, GET_RETURN_STATUS, napi_env__::isolate, napi_generic_failure, napi_invalid_arg, NAPI_PREAMBLE, node::Buffer::New(), RETURN_STATUS_IF_FALSE, and wrap.
const char* error_messages[] |
Definition at line 871 of file node_api.cc.
Referenced by napi_get_last_error_info().