From d2d151a090818ae71b69d9d6d6827d0689f7c0f6 Mon Sep 17 00:00:00 2001 From: toyobayashi Date: Mon, 19 Jan 2026 10:21:02 +0800 Subject: [PATCH] feat!: fix `node_api_create_object_with_properties` name --- packages/emnapi/include/node/js_native_api.h | 12 ++++++------ packages/emnapi/src/value/create.ts | 2 +- packages/test/object/test_object.c | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/emnapi/include/node/js_native_api.h b/packages/emnapi/include/node/js_native_api.h index 0fdc31a0..251d8c45 100644 --- a/packages/emnapi/include/node/js_native_api.h +++ b/packages/emnapi/include/node/js_native_api.h @@ -59,12 +59,12 @@ NAPI_EXTERN napi_status NAPI_CDECL napi_create_object(napi_env env, #ifdef NAPI_EXPERIMENTAL #define NODE_API_EXPERIMENTAL_HAS_CREATE_OBJECT_WITH_PROPERTIES NAPI_EXTERN napi_status NAPI_CDECL -napi_create_object_with_properties(napi_env env, - napi_value prototype_or_null, - napi_value* property_names, - napi_value* property_values, - size_t property_count, - napi_value* result); +node_api_create_object_with_properties(napi_env env, + napi_value prototype_or_null, + napi_value* property_names, + napi_value* property_values, + size_t property_count, + napi_value* result); #endif // NAPI_EXPERIMENTAL NAPI_EXTERN napi_status NAPI_CDECL napi_create_array(napi_env env, diff --git a/packages/emnapi/src/value/create.ts b/packages/emnapi/src/value/create.ts index 9491eec4..5c5bbd3c 100644 --- a/packages/emnapi/src/value/create.ts +++ b/packages/emnapi/src/value/create.ts @@ -199,7 +199,7 @@ export function napi_create_object (env: napi_env, result: Pointer): /** * @__sig ipppppp */ -export function napi_create_object_with_properties ( +export function node_api_create_object_with_properties ( env: napi_env, prototype_or_null: napi_value, property_names: Pointer, diff --git a/packages/test/object/test_object.c b/packages/test/object/test_object.c index 40ac602d..fac9b202 100644 --- a/packages/test/object/test_object.c +++ b/packages/test/object/test_object.c @@ -743,7 +743,7 @@ static napi_value TestCreateObjectWithProperties(napi_env env, napi_value null_prototype; NODE_API_CALL(env, napi_get_null(env, &null_prototype)); NODE_API_CALL(env, - napi_create_object_with_properties( + node_api_create_object_with_properties( env, null_prototype, names, values, 3, &result)); return result; @@ -753,9 +753,9 @@ static napi_value TestCreateObjectWithPropertiesEmpty(napi_env env, napi_callback_info info) { napi_value result; - NODE_API_CALL( - env, - napi_create_object_with_properties(env, NULL, NULL, NULL, 0, &result)); + NODE_API_CALL(env, + node_api_create_object_with_properties( + env, NULL, NULL, NULL, 0, &result)); return result; } @@ -788,7 +788,7 @@ static napi_value TestCreateObjectWithCustomPrototype(napi_env env, NODE_API_CALL(env, napi_create_int32(env, 42, &values[0])); NODE_API_CALL(env, - napi_create_object_with_properties( + node_api_create_object_with_properties( env, prototype, names, values, 1, &result)); return result;