@@ -905,9 +905,9 @@ napi_value Init(napi_env env, napi_value exports) {
905
905
napi_status status;
906
906
napi_property_descriptor desc =
907
907
{"hello", Method, 0, 0, 0, napi_default, 0};
908
- if (status != napi_ok) return nullptr ;
908
+ if (status != napi_ok) return NULL ;
909
909
status = napi_define_properties(env, exports, 1, &desc);
910
- if (status != napi_ok) return nullptr ;
910
+ if (status != napi_ok) return NULL ;
911
911
return exports;
912
912
}
913
913
```
@@ -919,7 +919,7 @@ napi_value Init(napi_env env, napi_value exports) {
919
919
napi_value method;
920
920
napi_status status;
921
921
status = napi_create_function(env, "exports", Method, NULL, &method));
922
- if (status != napi_ok) return nullptr ;
922
+ if (status != napi_ok) return NULL ;
923
923
return method;
924
924
}
925
925
```
@@ -932,21 +932,21 @@ For example, to define a class so that new instances can be created
932
932
napi_value Init(napi_env env, napi_value exports) {
933
933
napi_status status;
934
934
napi_property_descriptor properties[] = {
935
- { "value", nullptr , GetValue, SetValue, 0, napi_default, 0 },
935
+ { "value", NULL , GetValue, SetValue, 0, napi_default, 0 },
936
936
DECLARE_NAPI_METHOD("plusOne", PlusOne),
937
937
DECLARE_NAPI_METHOD("multiply", Multiply),
938
938
};
939
939
940
940
napi_value cons;
941
941
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 ;
944
944
945
945
status = napi_create_reference(env, cons, 1, &constructor);
946
- if (status != napi_ok) return nullptr ;
946
+ if (status != napi_ok) return NULL ;
947
947
948
948
status = napi_set_named_property(env, exports, "MyObject", cons);
949
- if (status != napi_ok) return nullptr ;
949
+ if (status != napi_ok) return NULL ;
950
950
951
951
return exports;
952
952
}
@@ -2364,8 +2364,8 @@ if (status != napi_ok) return status;
2364
2364
2365
2365
// Set the properties
2366
2366
napi_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 }
2369
2369
}
2370
2370
status = napi_define_properties(env,
2371
2371
obj,
@@ -2876,18 +2876,18 @@ object. A sample module might look as follows:
2876
2876
```C
2877
2877
napi_value SayHello(napi_env env, napi_callback_info info) {
2878
2878
printf("Hello\n");
2879
- return nullptr ;
2879
+ return NULL ;
2880
2880
}
2881
2881
2882
2882
napi_value Init(napi_env env, napi_value exports) {
2883
2883
napi_status status;
2884
2884
2885
2885
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 ;
2888
2888
2889
2889
status = napi_set_named_property(env, exports, "sayHello", fn);
2890
- if (status != napi_ok) return nullptr ;
2890
+ if (status != napi_ok) return NULL ;
2891
2891
2892
2892
return exports;
2893
2893
}
@@ -2952,7 +2952,7 @@ napi_status napi_get_new_target(napi_env env,
2952
2952
Returns `napi_ok` if the API succeeded.
2953
2953
2954
2954
This 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 `.
2956
2956
2957
2957
### *napi_new_instance*
2958
2958
<!-- YAML
@@ -3034,7 +3034,7 @@ reference to the class constructor for later `instanceof` checks.
3034
3034
As an example:
3035
3035
3036
3036
```C
3037
- napi_value MyClass_constructor = nullptr ;
3037
+ napi_value MyClass_constructor = NULL ;
3038
3038
status = napi_get_reference_value(env, MyClass::es_constructor, &MyClass_constructor);
3039
3039
assert(napi_ok == status);
3040
3040
bool is_instance = false;
0 commit comments