Skip to content

Commit 5011ee1

Browse files
committed
Move the utf8name parameter to napi_create_function into the second slot to match napi_define_class
1 parent 5354ed7 commit 5011ee1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/node_jsvmapi.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -644,9 +644,9 @@ napi_status napi_get_current_env(napi_env* e) {
644644

645645
napi_status napi_create_function(
646646
napi_env e,
647+
const char* utf8name,
647648
napi_callback cb,
648649
void* data,
649-
const char* utf8name,
650650
napi_value* result) {
651651
NAPI_PREAMBLE(e);
652652
CHECK_ARG(result);

src/node_jsvmapi.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ NODE_EXTERN napi_status napi_create_symbol(napi_env e,
108108
const char* s,
109109
napi_value* result);
110110
NODE_EXTERN napi_status napi_create_function(napi_env e,
111+
const char* utf8name,
111112
napi_callback cb,
112113
void* data,
113-
const char* utf8name,
114114
napi_value* result);
115115
NODE_EXTERN napi_status napi_create_error(napi_env e,
116116
napi_value msg,

test/addons-abi/5_function_factory/binding.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void CreateFunction(napi_env env, napi_callback_info info) {
1515
napi_status status;
1616

1717
napi_value fn;
18-
status = napi_create_function(env, MyFunction, nullptr, "theFunction", &fn);
18+
status = napi_create_function(env, "theFunction", MyFunction, nullptr, &fn);
1919
if (status != napi_ok) return;
2020

2121
status = napi_set_return_value(env, info, fn);

0 commit comments

Comments
 (0)