Lines Matching full:env
6 static napi_value SetProperty(napi_env env, napi_callback_info info) { in SetProperty() argument
9 NODE_API_CALL(env, napi_create_object(env, &return_value)); in SetProperty()
10 NODE_API_CALL(env, napi_create_object(env, &object)); in SetProperty()
11 NODE_API_CALL(env, in SetProperty()
12 napi_create_string_utf8(env, "someString", NAPI_AUTO_LENGTH, &key)); in SetProperty()
14 add_returned_status(env, in SetProperty()
21 napi_set_property(env, NULL, key, object); in SetProperty()
22 add_last_status(env, "objectIsNull", return_value); in SetProperty()
24 napi_set_property(env, object, NULL, object); in SetProperty()
25 add_last_status(env, "keyIsNull", return_value); in SetProperty()
27 napi_set_property(env, object, key, NULL); in SetProperty()
28 add_last_status(env, "valueIsNull", return_value); in SetProperty()
33 static napi_value GetProperty(napi_env env, napi_callback_info info) { in GetProperty() argument
36 NODE_API_CALL(env, napi_create_object(env, &return_value)); in GetProperty()
37 NODE_API_CALL(env, napi_create_object(env, &object)); in GetProperty()
38 NODE_API_CALL(env, in GetProperty()
39 napi_create_string_utf8(env, "someString", NAPI_AUTO_LENGTH, &key)); in GetProperty()
41 add_returned_status(env, in GetProperty()
48 napi_get_property(env, NULL, key, &prop); in GetProperty()
49 add_last_status(env, "objectIsNull", return_value); in GetProperty()
51 napi_get_property(env, object, NULL, &prop); in GetProperty()
52 add_last_status(env, "keyIsNull", return_value); in GetProperty()
54 napi_get_property(env, object, key, NULL); in GetProperty()
55 add_last_status(env, "valueIsNull", return_value); in GetProperty()
60 static napi_value TestBoolValuedPropApi(napi_env env, in TestBoolValuedPropApi() argument
65 NODE_API_CALL(env, napi_create_object(env, &return_value)); in TestBoolValuedPropApi()
66 NODE_API_CALL(env, napi_create_object(env, &object)); in TestBoolValuedPropApi()
67 NODE_API_CALL(env, in TestBoolValuedPropApi()
68 napi_create_string_utf8(env, "someString", NAPI_AUTO_LENGTH, &key)); in TestBoolValuedPropApi()
70 add_returned_status(env, in TestBoolValuedPropApi()
77 api(env, NULL, key, &result); in TestBoolValuedPropApi()
78 add_last_status(env, "objectIsNull", return_value); in TestBoolValuedPropApi()
80 api(env, object, NULL, &result); in TestBoolValuedPropApi()
81 add_last_status(env, "keyIsNull", return_value); in TestBoolValuedPropApi()
83 api(env, object, key, NULL); in TestBoolValuedPropApi()
84 add_last_status(env, "valueIsNull", return_value); in TestBoolValuedPropApi()
89 static napi_value HasProperty(napi_env env, napi_callback_info info) { in HasProperty() argument
90 return TestBoolValuedPropApi(env, napi_has_property); in HasProperty()
93 static napi_value HasOwnProperty(napi_env env, napi_callback_info info) { in HasOwnProperty() argument
94 return TestBoolValuedPropApi(env, napi_has_own_property); in HasOwnProperty()
97 static napi_value DeleteProperty(napi_env env, napi_callback_info info) { in DeleteProperty() argument
98 return TestBoolValuedPropApi(env, napi_delete_property); in DeleteProperty()
101 static napi_value SetNamedProperty(napi_env env, napi_callback_info info) { in SetNamedProperty() argument
104 NODE_API_CALL(env, napi_create_object(env, &return_value)); in SetNamedProperty()
105 NODE_API_CALL(env, napi_create_object(env, &object)); in SetNamedProperty()
107 add_returned_status(env, in SetNamedProperty()
114 napi_set_named_property(env, NULL, "key", object); in SetNamedProperty()
115 add_last_status(env, "objectIsNull", return_value); in SetNamedProperty()
117 napi_set_named_property(env, object, NULL, object); in SetNamedProperty()
118 add_last_status(env, "keyIsNull", return_value); in SetNamedProperty()
120 napi_set_named_property(env, object, "key", NULL); in SetNamedProperty()
121 add_last_status(env, "valueIsNull", return_value); in SetNamedProperty()
126 static napi_value GetNamedProperty(napi_env env, napi_callback_info info) { in GetNamedProperty() argument
129 NODE_API_CALL(env, napi_create_object(env, &return_value)); in GetNamedProperty()
130 NODE_API_CALL(env, napi_create_object(env, &object)); in GetNamedProperty()
132 add_returned_status(env, in GetNamedProperty()
139 napi_get_named_property(env, NULL, "key", &prop); in GetNamedProperty()
140 add_last_status(env, "objectIsNull", return_value); in GetNamedProperty()
142 napi_get_named_property(env, object, NULL, &prop); in GetNamedProperty()
143 add_last_status(env, "keyIsNull", return_value); in GetNamedProperty()
145 napi_get_named_property(env, object, "key", NULL); in GetNamedProperty()
146 add_last_status(env, "valueIsNull", return_value); in GetNamedProperty()
151 static napi_value HasNamedProperty(napi_env env, napi_callback_info info) { in HasNamedProperty() argument
155 NODE_API_CALL(env, napi_create_object(env, &return_value)); in HasNamedProperty()
156 NODE_API_CALL(env, napi_create_object(env, &object)); in HasNamedProperty()
158 add_returned_status(env, in HasNamedProperty()
165 napi_has_named_property(env, NULL, "key", &result); in HasNamedProperty()
166 add_last_status(env, "objectIsNull", return_value); in HasNamedProperty()
168 napi_has_named_property(env, object, NULL, &result); in HasNamedProperty()
169 add_last_status(env, "keyIsNull", return_value); in HasNamedProperty()
171 napi_has_named_property(env, object, "key", NULL); in HasNamedProperty()
172 add_last_status(env, "valueIsNull", return_value); in HasNamedProperty()
177 static napi_value SetElement(napi_env env, napi_callback_info info) { in SetElement() argument
180 NODE_API_CALL(env, napi_create_object(env, &return_value)); in SetElement()
181 NODE_API_CALL(env, napi_create_object(env, &object)); in SetElement()
183 add_returned_status(env, in SetElement()
190 napi_set_element(env, NULL, 0, object); in SetElement()
191 add_last_status(env, "objectIsNull", return_value); in SetElement()
193 napi_set_property(env, object, 0, NULL); in SetElement()
194 add_last_status(env, "valueIsNull", return_value); in SetElement()
199 static napi_value GetElement(napi_env env, napi_callback_info info) { in GetElement() argument
202 NODE_API_CALL(env, napi_create_object(env, &return_value)); in GetElement()
203 NODE_API_CALL(env, napi_create_object(env, &object)); in GetElement()
205 add_returned_status(env, in GetElement()
212 napi_get_property(env, NULL, 0, &prop); in GetElement()
213 add_last_status(env, "objectIsNull", return_value); in GetElement()
215 napi_get_property(env, object, 0, NULL); in GetElement()
216 add_last_status(env, "valueIsNull", return_value); in GetElement()
221 static napi_value TestBoolValuedElementApi(napi_env env, in TestBoolValuedElementApi() argument
226 NODE_API_CALL(env, napi_create_object(env, &return_value)); in TestBoolValuedElementApi()
227 NODE_API_CALL(env, napi_create_object(env, &object)); in TestBoolValuedElementApi()
229 add_returned_status(env, in TestBoolValuedElementApi()
236 api(env, NULL, 0, &result); in TestBoolValuedElementApi()
237 add_last_status(env, "objectIsNull", return_value); in TestBoolValuedElementApi()
239 api(env, object, 0, NULL); in TestBoolValuedElementApi()
240 add_last_status(env, "valueIsNull", return_value); in TestBoolValuedElementApi()
245 static napi_value HasElement(napi_env env, napi_callback_info info) { in HasElement() argument
246 return TestBoolValuedElementApi(env, napi_has_element); in HasElement()
249 static napi_value DeleteElement(napi_env env, napi_callback_info info) { in DeleteElement() argument
250 return TestBoolValuedElementApi(env, napi_delete_element); in DeleteElement()
253 static napi_value DefineProperties(napi_env env, napi_callback_info info) { in DefineProperties() argument
260 NODE_API_CALL(env, napi_create_object(env, &object)); in DefineProperties()
261 NODE_API_CALL(env, napi_create_object(env, &return_value)); in DefineProperties()
263 add_returned_status(env, in DefineProperties()
270 napi_define_properties(env, NULL, 1, &desc); in DefineProperties()
271 add_last_status(env, "objectIsNull", return_value); in DefineProperties()
273 napi_define_properties(env, object, 1, NULL); in DefineProperties()
274 add_last_status(env, "descriptorListIsNull", return_value); in DefineProperties()
277 napi_define_properties(env, object, 1, NULL); in DefineProperties()
278 add_last_status(env, "utf8nameIsNull", return_value); in DefineProperties()
282 napi_define_properties(env, object, 1, NULL); in DefineProperties()
283 add_last_status(env, "methodIsNull", return_value); in DefineProperties()
289 static napi_value GetPropertyNames(napi_env env, napi_callback_info info) { in GetPropertyNames() argument
292 NODE_API_CALL(env, napi_create_object(env, &return_value)); in GetPropertyNames()
294 add_returned_status(env, in GetPropertyNames()
301 napi_get_property_names(env, NULL, &props); in GetPropertyNames()
302 add_last_status(env, "objectIsNull", return_value); in GetPropertyNames()
304 napi_get_property_names(env, return_value, NULL); in GetPropertyNames()
305 add_last_status(env, "valueIsNull", return_value); in GetPropertyNames()
310 static napi_value GetAllPropertyNames(napi_env env, napi_callback_info info) { in GetAllPropertyNames() argument
313 NODE_API_CALL(env, napi_create_object(env, &return_value)); in GetAllPropertyNames()
315 add_returned_status(env, in GetAllPropertyNames()
327 napi_get_all_property_names(env, in GetAllPropertyNames()
333 add_last_status(env, "objectIsNull", return_value); in GetAllPropertyNames()
335 napi_get_all_property_names(env, in GetAllPropertyNames()
341 add_last_status(env, "valueIsNull", return_value); in GetAllPropertyNames()
346 static napi_value GetPrototype(napi_env env, napi_callback_info info) { in GetPrototype() argument
349 NODE_API_CALL(env, napi_create_object(env, &return_value)); in GetPrototype()
351 add_returned_status(env, in GetPrototype()
358 napi_get_prototype(env, NULL, &proto); in GetPrototype()
359 add_last_status(env, "objectIsNull", return_value); in GetPrototype()
361 napi_get_prototype(env, return_value, NULL); in GetPrototype()
362 add_last_status(env, "valueIsNull", return_value); in GetPrototype()
367 void init_test_null(napi_env env, napi_value exports) { in init_test_null() argument
389 NODE_API_CALL_RETURN_VOID(env, napi_create_object(env, &test_null)); in init_test_null()
390 NODE_API_CALL_RETURN_VOID(env, napi_define_properties( in init_test_null()
391 env, test_null, sizeof(test_null_props) / sizeof(*test_null_props), in init_test_null()
398 NODE_API_CALL_RETURN_VOID(env, in init_test_null()
399 napi_define_properties(env, exports, 1, &test_null_set)); in init_test_null()