node-api: fix node_api_create_object_with_properties name · nodejs/node@5cc3596

File tree

5 files changed

lines changed

  • benchmark/napi/create_object_with_properties

  • test/js-native-api/test_object

5 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -58,7 +58,7 @@ static napi_value CreateObjectWithPropertiesNew(napi_env env,

5858
5959

for (uint32_t i = 0; i < params.count; i++) {

6060

napi_value obj;

61-

napi_create_object_with_properties(

61+

node_api_create_object_with_properties(

6262

env, null_prototype, global_names, global_values, 20, &obj);

6363

}

6464
Original file line numberDiff line numberDiff line change

@@ -2645,7 +2645,7 @@ It is the equivalent of doing `new Object()` in JavaScript.

26452645

The JavaScript `Object` type is described in [Section object type][] of the

26462646

ECMAScript Language Specification.

26472647
2648-

#### `napi_create_object_with_properties`

2648+

#### `node_api_create_object_with_properties`

26492649
26502650

<!-- YAML

26512651

added: v24.12.0

@@ -2654,12 +2654,12 @@ added: v24.12.0

26542654

> Stability: 1 - Experimental

26552655
26562656

```cpp

2657-

napi_status napi_create_object_with_properties(napi_env env,

2658-

napi_value prototype_or_null,

2659-

const napi_value* property_names,

2660-

const napi_value* property_values,

2661-

size_t property_count,

2662-

napi_value* result)

2657+

napi_status node_api_create_object_with_properties(napi_env env,

2658+

napi_value prototype_or_null,

2659+

const napi_value* property_names,

2660+

const napi_value* property_values,

2661+

size_t property_count,

2662+

napi_value* result)

26632663

```

26642664
26652665

* `[in] env`: The environment that the API is invoked under.

Original file line numberDiff line numberDiff line change

@@ -53,12 +53,12 @@ NAPI_EXTERN napi_status NAPI_CDECL napi_create_object(napi_env env,

5353

#ifdef NAPI_EXPERIMENTAL

5454

#define NODE_API_EXPERIMENTAL_HAS_CREATE_OBJECT_WITH_PROPERTIES

5555

NAPI_EXTERN napi_status NAPI_CDECL

56-

napi_create_object_with_properties(napi_env env,

57-

napi_value prototype_or_null,

58-

napi_value* property_names,

59-

napi_value* property_values,

60-

size_t property_count,

61-

napi_value* result);

56+

node_api_create_object_with_properties(napi_env env,

57+

napi_value prototype_or_null,

58+

napi_value* property_names,

59+

napi_value* property_values,

60+

size_t property_count,

61+

napi_value* result);

6262

#endif // NAPI_EXPERIMENTAL

6363
6464

NAPI_EXTERN napi_status NAPI_CDECL napi_create_array(napi_env env,

Original file line numberDiff line numberDiff line change

@@ -1613,12 +1613,12 @@ napi_status NAPI_CDECL napi_create_object(napi_env env, napi_value* result) {

16131613

}

16141614
16151615

napi_status NAPI_CDECL

1616-

napi_create_object_with_properties(napi_env env,

1617-

napi_value prototype_or_null,

1618-

napi_value* property_names,

1619-

napi_value* property_values,

1620-

size_t property_count,

1621-

napi_value* result) {

1616+

node_api_create_object_with_properties(napi_env env,

1617+

napi_value prototype_or_null,

1618+

napi_value* property_names,

1619+

napi_value* property_values,

1620+

size_t property_count,

1621+

napi_value* result) {

16221622

CHECK_ENV_NOT_IN_GC(env);

16231623

CHECK_ARG(env, result);

16241624
Original file line numberDiff line numberDiff line change

@@ -732,7 +732,7 @@ static napi_value TestCreateObjectWithProperties(napi_env env,

732732

napi_value null_prototype;

733733

NODE_API_CALL(env, napi_get_null(env, &null_prototype));

734734

NODE_API_CALL(env,

735-

napi_create_object_with_properties(

735+

node_api_create_object_with_properties(

736736

env, null_prototype, names, values, 3, &result));

737737
738738

return result;

@@ -742,9 +742,9 @@ static napi_value TestCreateObjectWithPropertiesEmpty(napi_env env,

742742

napi_callback_info info) {

743743

napi_value result;

744744
745-

NODE_API_CALL(

746-

env,

747-

napi_create_object_with_properties(env, NULL, NULL, NULL, 0, &result));

745+

NODE_API_CALL(env,

746+

node_api_create_object_with_properties(

747+

env, NULL, NULL, NULL, 0, &result));

748748
749749

return result;

750750

}

@@ -777,7 +777,7 @@ static napi_value TestCreateObjectWithCustomPrototype(napi_env env,

777777

NODE_API_CALL(env, napi_create_int32(env, 42, &values[0]));

778778
779779

NODE_API_CALL(env,

780-

napi_create_object_with_properties(

780+

node_api_create_object_with_properties(

781781

env, prototype, names, values, 1, &result));

782782
783783

return result;