Skip to content

Commit 0a6852b

Browse files
committed
add back the old deprecated method
1 parent dfd1f3c commit 0a6852b

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/js_native_api.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,17 @@ node_api_create_object_with_properties(napi_env env,
5959
napi_value* property_values,
6060
size_t property_count,
6161
napi_value* result);
62+
63+
#if defined(__cplusplus) && __cplusplus >= 201402L
64+
[[deprecated("Use node_api_create_object_with_properties instead")]]
65+
#endif
66+
NAPI_EXTERN napi_status NAPI_CDECL
67+
napi_create_object_with_properties(napi_env env,
68+
napi_value prototype_or_null,
69+
napi_value* property_names,
70+
napi_value* property_values,
71+
size_t property_count,
72+
napi_value* result);
6273
#endif // NAPI_EXPERIMENTAL
6374

6475
NAPI_EXTERN napi_status NAPI_CDECL napi_create_array(napi_env env,

src/js_native_api_v8.cc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,6 +1657,21 @@ node_api_create_object_with_properties(napi_env env,
16571657
return napi_clear_last_error(env);
16581658
}
16591659

1660+
napi_status NAPI_CDECL
1661+
napi_create_object_with_properties(napi_env env,
1662+
napi_value prototype_or_null,
1663+
napi_value* property_names,
1664+
napi_value* property_values,
1665+
size_t property_count,
1666+
napi_value* result) {
1667+
return node_api_create_object_with_properties(env,
1668+
prototype_or_null,
1669+
property_names,
1670+
property_values,
1671+
property_count,
1672+
result);
1673+
}
1674+
16601675
napi_status NAPI_CDECL napi_create_array(napi_env env, napi_value* result) {
16611676
CHECK_ENV_NOT_IN_GC(env);
16621677
CHECK_ARG(env, result);

0 commit comments

Comments
 (0)