Skip to content

Commit 78a9aaa

Browse files
netagibfahn
neta
authored andcommitted
src: add napi_handle_scope_mismatch to msg list
PR-URL: #17161 Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
1 parent 861082a commit 78a9aaa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/node_api.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,8 @@ const char* error_messages[] = {nullptr,
898898
"Unknown failure",
899899
"An exception is pending",
900900
"The async work item was cancelled",
901-
"napi_escape_handle already called on scope"};
901+
"napi_escape_handle already called on scope",
902+
"Invalid handle scope usage"};
902903

903904
static inline napi_status napi_clear_last_error(napi_env env) {
904905
env->last_error.error_code = napi_ok;
@@ -929,9 +930,9 @@ napi_status napi_get_last_error_info(napi_env env,
929930
// We don't have a napi_status_last as this would result in an ABI
930931
// change each time a message was added.
931932
static_assert(
932-
node::arraysize(error_messages) == napi_escape_called_twice + 1,
933+
node::arraysize(error_messages) == napi_handle_scope_mismatch + 1,
933934
"Count of error messages must match count of error values");
934-
CHECK_LE(env->last_error.error_code, napi_escape_called_twice);
935+
CHECK_LE(env->last_error.error_code, napi_handle_scope_mismatch);
935936

936937
// Wait until someone requests the last error information to fetch the error
937938
// message string

0 commit comments

Comments
 (0)