Unless I'm missing something, #16201 should've also updated
|
// you must update this assert to reference the last message |
|
// in the napi_status enum each time a new error message is added. |
|
// We don't have a napi_status_last as this would result in an ABI |
|
// change each time a message was added. |
|
static_assert( |
|
node::arraysize(error_messages) == napi_escape_called_twice + 1, |
|
"Count of error messages must match count of error values"); |
|
CHECK_LE(env->last_error.error_code, napi_escape_called_twice); |
and
|
const char* error_messages[] = {nullptr, |
|
"Invalid argument", |
|
"An object was expected", |
|
"A string was expected", |
|
"A string or symbol was expected", |
|
"A function was expected", |
|
"A number was expected", |
|
"A boolean was expected", |
|
"An array was expected", |
|
"Unknown failure", |
|
"An exception is pending", |
|
"The async work item was cancelled", |
|
"napi_escape_handle already called on scope"}; |
, as currently assertion at
|
CHECK_LE(env->last_error.error_code, napi_escape_called_twice); |
will fail whenever someone tries to call
napi_get_last_error_info right after
napi_handle_scope_mismatch occurred.
Unless I'm missing something, #16201 should've also updated
node/src/node_api.cc
Lines 927 to 934 in c5a49e1
node/src/node_api.cc
Lines 889 to 901 in c5a49e1
node/src/node_api.cc
Line 934 in c5a49e1
napi_get_last_error_inforight afternapi_handle_scope_mismatchoccurred.