@@ -903,9 +903,9 @@ napi_value Init(napi_env env, napi_value exports) {
903
903
napi_status status;
904
904
napi_property_descriptor desc =
905
905
{"hello", Method, 0, 0, 0, napi_default, 0};
906
- if (status != napi_ok) return nullptr ;
906
+ if (status != napi_ok) return NULL ;
907
907
status = napi_define_properties(env, exports, 1, &desc);
908
- if (status != napi_ok) return nullptr ;
908
+ if (status != napi_ok) return NULL ;
909
909
return exports;
910
910
}
911
911
```
@@ -917,7 +917,7 @@ napi_value Init(napi_env env, napi_value exports) {
917
917
napi_value method;
918
918
napi_status status;
919
919
status = napi_create_function(env, "exports", Method, NULL, &method));
920
- if (status != napi_ok) return nullptr ;
920
+ if (status != napi_ok) return NULL ;
921
921
return method;
922
922
}
923
923
```
@@ -930,21 +930,21 @@ For example, to define a class so that new instances can be created
930
930
napi_value Init(napi_env env, napi_value exports) {
931
931
napi_status status;
932
932
napi_property_descriptor properties[] = {
933
- { "value", nullptr , GetValue, SetValue, 0, napi_default, 0 },
933
+ { "value", NULL , GetValue, SetValue, 0, napi_default, 0 },
934
934
DECLARE_NAPI_METHOD("plusOne", PlusOne),
935
935
DECLARE_NAPI_METHOD("multiply", Multiply),
936
936
};
937
937
938
938
napi_value cons;
939
939
status =
940
- napi_define_class(env, "MyObject", New, nullptr , 3, properties, &cons);
941
- if (status != napi_ok) return nullptr ;
940
+ napi_define_class(env, "MyObject", New, NULL , 3, properties, &cons);
941
+ if (status != napi_ok) return NULL ;
942
942
943
943
status = napi_create_reference(env, cons, 1, &constructor);
944
- if (status != napi_ok) return nullptr ;
944
+ if (status != napi_ok) return NULL ;
945
945
946
946
status = napi_set_named_property(env, exports, "MyObject", cons);
947
- if (status != napi_ok) return nullptr ;
947
+ if (status != napi_ok) return NULL ;
948
948
949
949
return exports;
950
950
}
@@ -2362,8 +2362,8 @@ if (status != napi_ok) return status;
2362
2362
2363
2363
// Set the properties
2364
2364
napi_property_descriptor descriptors[] = {
2365
- { "foo", nullptr , 0, 0, 0, fooValue, napi_default, 0 },
2366
- { "bar", nullptr , 0, 0, 0, barValue, napi_default, 0 }
2365
+ { "foo", NULL , 0, 0, 0, fooValue, napi_default, 0 },
2366
+ { "bar", NULL , 0, 0, 0, barValue, napi_default, 0 }
2367
2367
}
2368
2368
status = napi_define_properties(env,
2369
2369
obj,
@@ -2874,18 +2874,18 @@ object. A sample module might look as follows:
2874
2874
```C
2875
2875
napi_value SayHello(napi_env env, napi_callback_info info) {
2876
2876
printf("Hello\n");
2877
- return nullptr ;
2877
+ return NULL ;
2878
2878
}
2879
2879
2880
2880
napi_value Init(napi_env env, napi_value exports) {
2881
2881
napi_status status;
2882
2882
2883
2883
napi_value fn;
2884
- status = napi_create_function(env, nullptr , 0, SayHello, nullptr , &fn);
2885
- if (status != napi_ok) return nullptr ;
2884
+ status = napi_create_function(env, NULL , 0, SayHello, NULL , &fn);
2885
+ if (status != napi_ok) return NULL ;
2886
2886
2887
2887
status = napi_set_named_property(env, exports, "sayHello", fn);
2888
- if (status != napi_ok) return nullptr ;
2888
+ if (status != napi_ok) return NULL ;
2889
2889
2890
2890
return exports;
2891
2891
}
@@ -2950,7 +2950,7 @@ napi_status napi_get_new_target(napi_env env,
2950
2950
Returns `napi_ok` if the API succeeded.
2951
2951
2952
2952
This API returns the `new.target` of the constructor call. If the current
2953
- callback is not a constructor call, the result is `nullptr `.
2953
+ callback is not a constructor call, the result is `NULL `.
2954
2954
2955
2955
### *napi_new_instance*
2956
2956
<!-- YAML
@@ -3032,7 +3032,7 @@ reference to the class constructor for later `instanceof` checks.
3032
3032
As an example:
3033
3033
3034
3034
```C
3035
- napi_value MyClass_constructor = nullptr ;
3035
+ napi_value MyClass_constructor = NULL ;
3036
3036
status = napi_get_reference_value(env, MyClass::es_constructor, &MyClass_constructor);
3037
3037
assert(napi_ok == status);
3038
3038
bool is_instance = false;
0 commit comments