Skip to content

Commit 1f5a85d

Browse files
Update headers from nodejs/node tag v20.3.0 (#30)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 62d0674 commit 1f5a85d

6 files changed

+48
-4
lines changed

def/js_native_api.def

+4-1
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,7 @@ napi_is_detached_arraybuffer
114114
napi_check_object_type_tag
115115
napi_object_freeze
116116
napi_object_seal
117-
napi_type_tag_object
117+
napi_type_tag_object
118+
node_api_create_syntax_error
119+
node_api_symbol_for
120+
node_api_throw_syntax_error

def/node_api.def

+5-1
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,8 @@ napi_remove_async_cleanup_hook
144144
napi_check_object_type_tag
145145
napi_object_freeze
146146
napi_object_seal
147-
napi_type_tag_object
147+
napi_type_tag_object
148+
node_api_get_module_file_name
149+
node_api_create_syntax_error
150+
node_api_symbol_for
151+
node_api_throw_syntax_error

include/js_native_api.h

+16
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ NAPI_EXTERN napi_status NAPI_CDECL napi_create_string_utf16(napi_env env,
9191
NAPI_EXTERN napi_status NAPI_CDECL napi_create_symbol(napi_env env,
9292
napi_value description,
9393
napi_value* result);
94+
#if NAPI_VERSION >= 9
95+
NAPI_EXTERN napi_status NAPI_CDECL
96+
node_api_symbol_for(napi_env env,
97+
const char* utf8description,
98+
size_t length,
99+
napi_value* result);
100+
#endif // NAPI_VERSION >= 9
94101
NAPI_EXTERN napi_status NAPI_CDECL napi_create_function(napi_env env,
95102
const char* utf8name,
96103
size_t length,
@@ -109,6 +116,10 @@ NAPI_EXTERN napi_status NAPI_CDECL napi_create_range_error(napi_env env,
109116
napi_value code,
110117
napi_value msg,
111118
napi_value* result);
119+
#if NAPI_VERSION >= 9
120+
NAPI_EXTERN napi_status NAPI_CDECL node_api_create_syntax_error(
121+
napi_env env, napi_value code, napi_value msg, napi_value* result);
122+
#endif // NAPI_VERSION >= 9
112123

113124
// Methods to get the native napi_value from Primitive type
114125
NAPI_EXTERN napi_status NAPI_CDECL napi_typeof(napi_env env,
@@ -363,6 +374,11 @@ NAPI_EXTERN napi_status NAPI_CDECL napi_throw_type_error(napi_env env,
363374
NAPI_EXTERN napi_status NAPI_CDECL napi_throw_range_error(napi_env env,
364375
const char* code,
365376
const char* msg);
377+
#if NAPI_VERSION >= 9
378+
NAPI_EXTERN napi_status NAPI_CDECL node_api_throw_syntax_error(napi_env env,
379+
const char* code,
380+
const char* msg);
381+
#endif // NAPI_VERSION >= 9
366382
NAPI_EXTERN napi_status NAPI_CDECL napi_is_error(napi_env env,
367383
napi_value value,
368384
bool* result);

include/js_native_api_types.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ typedef enum {
9999
napi_arraybuffer_expected,
100100
napi_detachable_arraybuffer_expected,
101101
napi_would_deadlock, // unused
102-
napi_no_external_buffers_allowed
102+
napi_no_external_buffers_allowed,
103+
napi_cannot_run_js,
103104
} napi_status;
104105
// Note: when adding a new enum value to `napi_status`, please also update
105106
// * `const int last_status` in the definition of `napi_get_last_error_info()'

include/node_api.h

+6
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@ napi_remove_async_cleanup_hook(napi_async_cleanup_hook_handle remove_handle);
248248

249249
#endif // NAPI_VERSION >= 8
250250

251+
#if NAPI_VERSION >= 9
252+
253+
NAPI_EXTERN napi_status NAPI_CDECL
254+
node_api_get_module_file_name(napi_env env, const char** result);
255+
256+
#endif // NAPI_VERSION >= 9
251257

252258
EXTERN_C_END
253259

symbols.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,19 @@ const v8 = {
215215
]
216216
}
217217

218+
const v9 = {
219+
js_native_api_symbols: [
220+
...v8.js_native_api_symbols,
221+
'node_api_create_syntax_error',
222+
'node_api_symbol_for',
223+
'node_api_throw_syntax_error'
224+
],
225+
node_api_symbols: [
226+
...v8.node_api_symbols,
227+
'node_api_get_module_file_name'
228+
]
229+
}
230+
218231
module.exports = {
219232
v1,
220233
v2,
@@ -223,5 +236,6 @@ module.exports = {
223236
v5,
224237
v6,
225238
v7,
226-
v8
239+
v8,
240+
v9
227241
}

0 commit comments

Comments
 (0)