Skip to content

Commit 64747b1

Browse files
authoredJan 9, 2025··
feat: update headers from nodejs/node tag v23.6.0 (#57)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent adc76e7 commit 64747b1

File tree

5 files changed

+64
-7
lines changed

5 files changed

+64
-7
lines changed
 

‎def/js_native_api.def

+6-1
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,9 @@ napi_object_seal
117117
napi_type_tag_object
118118
node_api_create_syntax_error
119119
node_api_symbol_for
120-
node_api_throw_syntax_error
120+
node_api_throw_syntax_error
121+
node_api_create_external_string_latin1
122+
node_api_create_external_string_utf16
123+
node_api_create_property_key_latin1
124+
node_api_create_property_key_utf16
125+
node_api_create_property_key_utf8

‎def/node_api.def

+7-1
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,10 @@ napi_type_tag_object
148148
node_api_get_module_file_name
149149
node_api_create_syntax_error
150150
node_api_symbol_for
151-
node_api_throw_syntax_error
151+
node_api_throw_syntax_error
152+
node_api_create_buffer_from_arraybuffer
153+
node_api_create_external_string_latin1
154+
node_api_create_external_string_utf16
155+
node_api_create_property_key_latin1
156+
node_api_create_property_key_utf16
157+
node_api_create_property_key_utf8

‎include/js_native_api.h

+25-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,31 @@ NAPI_EXTERN napi_status NAPI_CDECL napi_create_string_utf16(napi_env env,
8888
const char16_t* str,
8989
size_t length,
9090
napi_value* result);
91-
91+
#if NAPI_VERSION >= 10
92+
NAPI_EXTERN napi_status NAPI_CDECL node_api_create_external_string_latin1(
93+
napi_env env,
94+
char* str,
95+
size_t length,
96+
node_api_basic_finalize finalize_callback,
97+
void* finalize_hint,
98+
napi_value* result,
99+
bool* copied);
100+
NAPI_EXTERN napi_status NAPI_CDECL
101+
node_api_create_external_string_utf16(napi_env env,
102+
char16_t* str,
103+
size_t length,
104+
node_api_basic_finalize finalize_callback,
105+
void* finalize_hint,
106+
napi_value* result,
107+
bool* copied);
108+
109+
NAPI_EXTERN napi_status NAPI_CDECL node_api_create_property_key_latin1(
110+
napi_env env, const char* str, size_t length, napi_value* result);
111+
NAPI_EXTERN napi_status NAPI_CDECL node_api_create_property_key_utf8(
112+
napi_env env, const char* str, size_t length, napi_value* result);
113+
NAPI_EXTERN napi_status NAPI_CDECL node_api_create_property_key_utf16(
114+
napi_env env, const char16_t* str, size_t length, napi_value* result);
115+
#endif // NAPI_VERSION >= 10
92116

93117
NAPI_EXTERN napi_status NAPI_CDECL napi_create_symbol(napi_env env,
94118
napi_value description,

‎include/node_api.h

+9-3
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ EXTERN_C_START
9090

9191
// Deprecated. Replaced by symbol-based registration defined by NAPI_MODULE
9292
// and NAPI_MODULE_INIT macros.
93-
#if defined(__cplusplus) && __cplusplus >= 201402L
94-
[[deprecated]]
95-
#endif
9693
NAPI_EXTERN void NAPI_CDECL
9794
napi_module_register(napi_module* mod);
9895

@@ -136,6 +133,15 @@ napi_create_external_buffer(napi_env env,
136133
napi_value* result);
137134
#endif // NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED
138135

136+
#if NAPI_VERSION >= 10
137+
138+
NAPI_EXTERN napi_status NAPI_CDECL
139+
node_api_create_buffer_from_arraybuffer(napi_env env,
140+
napi_value arraybuffer,
141+
size_t byte_offset,
142+
size_t byte_length,
143+
napi_value* result);
144+
#endif // NAPI_VERSION >= 10
139145

140146
NAPI_EXTERN napi_status NAPI_CDECL napi_create_buffer_copy(napi_env env,
141147
size_t length,

‎symbols.js

+17-1
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,21 @@ const v9 = {
228228
]
229229
}
230230

231+
const v10 = {
232+
js_native_api_symbols: [
233+
...v9.js_native_api_symbols,
234+
'node_api_create_external_string_latin1',
235+
'node_api_create_external_string_utf16',
236+
'node_api_create_property_key_latin1',
237+
'node_api_create_property_key_utf16',
238+
'node_api_create_property_key_utf8'
239+
],
240+
node_api_symbols: [
241+
...v9.node_api_symbols,
242+
'node_api_create_buffer_from_arraybuffer'
243+
]
244+
}
245+
231246
module.exports = {
232247
v1,
233248
v2,
@@ -237,5 +252,6 @@ module.exports = {
237252
v6,
238253
v7,
239254
v8,
240-
v9
255+
v9,
256+
v10
241257
}

0 commit comments

Comments
 (0)
Please sign in to comment.