Skip to content

Commit b20c278

Browse files
netaMylesBorins
neta
authored andcommittedApr 16, 2018
src: add napi_handle_scope_mismatch to msg list
Backport-PR-URL: #19447 PR-URL: #17161 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
1 parent f4391b9 commit b20c278

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎src/node_api.cc

+4-3
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,8 @@ const char* error_messages[] = {nullptr,
909909
"Unknown failure",
910910
"An exception is pending",
911911
"The async work item was cancelled",
912-
"napi_escape_handle already called on scope"};
912+
"napi_escape_handle already called on scope",
913+
"Invalid handle scope usage"};
913914

914915
static inline napi_status napi_clear_last_error(napi_env env) {
915916
env->last_error.error_code = napi_ok;
@@ -940,9 +941,9 @@ napi_status napi_get_last_error_info(napi_env env,
940941
// We don't have a napi_status_last as this would result in an ABI
941942
// change each time a message was added.
942943
static_assert(
943-
node::arraysize(error_messages) == napi_escape_called_twice + 1,
944+
node::arraysize(error_messages) == napi_handle_scope_mismatch + 1,
944945
"Count of error messages must match count of error values");
945-
CHECK_LE(env->last_error.error_code, napi_escape_called_twice);
946+
CHECK_LE(env->last_error.error_code, napi_handle_scope_mismatch);
946947

947948
// Wait until someone requests the last error information to fetch the error
948949
// message string

0 commit comments

Comments
 (0)
Please sign in to comment.