@@ -905,9 +905,9 @@ napi_value Init(napi_env env, napi_value exports) {
905905 napi_status status;
906906 napi_property_descriptor desc =
907907 {"hello", Method, 0, 0, 0, napi_default, 0};
908- if (status != napi_ok) return nullptr ;
908+ if (status != napi_ok) return NULL ;
909909 status = napi_define_properties(env, exports, 1, &desc);
910- if (status != napi_ok) return nullptr ;
910+ if (status != napi_ok) return NULL ;
911911 return exports;
912912}
913913```
@@ -919,7 +919,7 @@ napi_value Init(napi_env env, napi_value exports) {
919919 napi_value method;
920920 napi_status status;
921921 status = napi_create_function(env, "exports", Method, NULL, &method));
922- if (status != napi_ok) return nullptr ;
922+ if (status != napi_ok) return NULL ;
923923 return method;
924924}
925925```
@@ -932,21 +932,21 @@ For example, to define a class so that new instances can be created
932932napi_value Init(napi_env env, napi_value exports) {
933933 napi_status status;
934934 napi_property_descriptor properties[] = {
935- { "value", nullptr , GetValue, SetValue, 0, napi_default, 0 },
935+ { "value", NULL , GetValue, SetValue, 0, napi_default, 0 },
936936 DECLARE_NAPI_METHOD("plusOne", PlusOne),
937937 DECLARE_NAPI_METHOD("multiply", Multiply),
938938 };
939939
940940 napi_value cons;
941941 status =
942- napi_define_class(env, "MyObject", New, nullptr , 3, properties, &cons);
943- if (status != napi_ok) return nullptr ;
942+ napi_define_class(env, "MyObject", New, NULL , 3, properties, &cons);
943+ if (status != napi_ok) return NULL ;
944944
945945 status = napi_create_reference(env, cons, 1, &constructor);
946- if (status != napi_ok) return nullptr ;
946+ if (status != napi_ok) return NULL ;
947947
948948 status = napi_set_named_property(env, exports, "MyObject", cons);
949- if (status != napi_ok) return nullptr ;
949+ if (status != napi_ok) return NULL ;
950950
951951 return exports;
952952}
@@ -2364,8 +2364,8 @@ if (status != napi_ok) return status;
23642364
23652365// Set the properties
23662366napi_property_descriptor descriptors[] = {
2367- { "foo", nullptr , 0, 0, 0, fooValue, napi_default, 0 },
2368- { "bar", nullptr , 0, 0, 0, barValue, napi_default, 0 }
2367+ { "foo", NULL , 0, 0, 0, fooValue, napi_default, 0 },
2368+ { "bar", NULL , 0, 0, 0, barValue, napi_default, 0 }
23692369}
23702370status = napi_define_properties(env,
23712371 obj,
@@ -2876,18 +2876,18 @@ object. A sample module might look as follows:
28762876```C
28772877napi_value SayHello(napi_env env, napi_callback_info info) {
28782878 printf("Hello\n");
2879- return nullptr ;
2879+ return NULL ;
28802880}
28812881
28822882napi_value Init(napi_env env, napi_value exports) {
28832883 napi_status status;
28842884
28852885 napi_value fn;
2886- status = napi_create_function(env, nullptr , 0, SayHello, nullptr , &fn);
2887- if (status != napi_ok) return nullptr ;
2886+ status = napi_create_function(env, NULL , 0, SayHello, NULL , &fn);
2887+ if (status != napi_ok) return NULL ;
28882888
28892889 status = napi_set_named_property(env, exports, "sayHello", fn);
2890- if (status != napi_ok) return nullptr ;
2890+ if (status != napi_ok) return NULL ;
28912891
28922892 return exports;
28932893}
@@ -2952,7 +2952,7 @@ napi_status napi_get_new_target(napi_env env,
29522952Returns `napi_ok` if the API succeeded.
29532953
29542954This API returns the `new.target` of the constructor call. If the current
2955- callback is not a constructor call, the result is `nullptr `.
2955+ callback is not a constructor call, the result is `NULL `.
29562956
29572957### *napi_new_instance*
29582958<!-- YAML
@@ -3034,7 +3034,7 @@ reference to the class constructor for later `instanceof` checks.
30343034As an example:
30353035
30363036```C
3037- napi_value MyClass_constructor = nullptr ;
3037+ napi_value MyClass_constructor = NULL ;
30383038status = napi_get_reference_value(env, MyClass::es_constructor, &MyClass_constructor);
30393039assert(napi_ok == status);
30403040bool is_instance = false;
0 commit comments