You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
napi_status status = napi_get_cb_info(env, info, &argc, argv, &recv, nullptr);
1183
+
1184
+
node_loader_impl_exception(env, status);
1185
+
1186
+
if (argc != 1)
1187
+
{
1188
+
napi_throw_type_error(env, NULL, "Invalid number of arguments, use it like: metacall_value_dereference(ptr);");
1189
+
returnnullptr;
1190
+
}
1191
+
1192
+
napi_valuetype type;
1193
+
1194
+
status = napi_typeof(env, argv[0], &type);
1195
+
node_loader_impl_exception(env, status);
1196
+
1197
+
if (type != napi_external)
1198
+
{
1199
+
napi_throw_type_error(env, NULL, "Invalid parameter type in first argument must be a PyCapsule (i.e a previously allocated pointer)");
1200
+
returnNULL;
1201
+
}
1202
+
1203
+
// Get the external pointer
1204
+
status = napi_get_value_external(env, argv[0], &v);
1205
+
1206
+
node_loader_impl_exception(env, status);
1207
+
1208
+
// If it is not contained in the set, it is not a valid value
1209
+
if (metacall_value_reference_pointers.find(v) == metacall_value_reference_pointers.end())
1210
+
{
1211
+
napi_throw_type_error(env, NULL, "Invalid reference, argument must be a PyCapsule containing a MetaCall value, use it only with values returned by metacall_value_reference");
PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid reference, argument must be a PyCapsule from MetaCall");
849
+
PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid reference, argument must be a PyCapsule containing a MetaCall value, use it only with values returned by metacall_value_reference");
0 commit comments