Lines Matching refs:env
7 static napi_value CallWithString(napi_env env, napi_callback_info info) {
12 status = napi_get_cb_info(env, info, &argc, args, NULL, NULL);
16 status = napi_typeof(env, args[0], types);
23 status = napi_get_value_string_utf8(env, args[0], NULL, 0, &len);
26 status = napi_get_value_string_utf8(env, args[0], buf, len + 1, &len);
34 static napi_value CallWithArray(napi_env env, napi_callback_info info) {
39 status = napi_get_cb_info(env, info, &argc, args, NULL, NULL);
44 status = napi_is_array(env, array, &is_array);
50 status = napi_get_array_length(env, array, &length);
56 status = napi_get_element(env, array, i, &v);
64 static napi_value CallWithNumber(napi_env env, napi_callback_info info) {
69 status = napi_get_cb_info(env, info, &argc, args, NULL, NULL);
73 status = napi_typeof(env, args[0], types);
79 status = napi_get_value_double(env, args[0], &value);
86 static napi_value CallWithObject(napi_env env, napi_callback_info info) {
91 status = napi_get_cb_info(env, info, &argc, args, NULL, NULL);
95 status = napi_typeof(env, args[0], types);
102 status = napi_get_named_property(env, args[0], "map", &value);
105 status = napi_get_named_property(env, args[0], "operand", &value);
108 status = napi_get_named_property(env, args[0], "data", &value);
111 status = napi_get_named_property(env, args[0], "reduce", &value);
118 static napi_value CallWithTypedarray(napi_env env, napi_callback_info info) {
123 status = napi_get_cb_info(env, info, &argc, args, NULL, NULL);
127 status = napi_is_typedarray(env, args[0], &is_typedarray);
136 status = napi_get_typedarray_info(env, args[0], &type, &length,
143 status = napi_get_arraybuffer_info(env,
154 static napi_value CallWithArguments(napi_env env, napi_callback_info info) {
160 status = napi_get_cb_info(env, info, &argc, NULL, NULL, NULL);
163 status = napi_get_cb_info(env, info, &argc, args, NULL, NULL);
168 status = napi_typeof(env, args[0], types);
174 status = napi_get_value_uint32(env, args[0], &loop);
180 status = napi_typeof(env, args[i], types);
185 status = napi_get_value_uint32(env, args[i], &value);
194 #define EXPORT_FUNC(env, exports, name, func) \
198 status = napi_create_function((env), \
205 status = napi_set_named_property((env), \
214 EXPORT_FUNC(env, exports, "callWithString", CallWithString);
215 EXPORT_FUNC(env, exports, "callWithLongString", CallWithString);
217 EXPORT_FUNC(env, exports, "callWithArray", CallWithArray);
218 EXPORT_FUNC(env, exports, "callWithLargeArray", CallWithArray);
219 EXPORT_FUNC(env, exports, "callWithHugeArray", CallWithArray);
221 EXPORT_FUNC(env, exports, "callWithNumber", CallWithNumber);
223 EXPORT_FUNC(env, exports, "callWithObject", CallWithObject);
224 EXPORT_FUNC(env, exports, "callWithTypedarray", CallWithTypedarray);
226 EXPORT_FUNC(env, exports, "callWith10Numbers", CallWithArguments);
227 EXPORT_FUNC(env, exports, "callWith100Numbers", CallWithArguments);
228 EXPORT_FUNC(env, exports, "callWith1000Numbers", CallWithArguments);