Skip to content

Commit ed8cee6

Browse files
Gabriel Schulhoftargos
Gabriel Schulhof
authored andcommitted
n-api: add error message for date expected
PR-URL: #28303 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent d759e0f commit ed8cee6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/js_native_api_v8.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ const char* error_messages[] = {nullptr,
676676
"Thread-safe function queue is full",
677677
"Thread-safe function handle is closing",
678678
"A bigint was expected",
679+
"A date was expected",
679680
};
680681

681682
napi_status napi_get_last_error_info(napi_env env,
@@ -688,7 +689,7 @@ napi_status napi_get_last_error_info(napi_env env,
688689
// We don't have a napi_status_last as this would result in an ABI
689690
// change each time a message was added.
690691
static_assert(
691-
NAPI_ARRAYSIZE(error_messages) == napi_bigint_expected + 1,
692+
NAPI_ARRAYSIZE(error_messages) == napi_date_expected + 1,
692693
"Count of error messages must match count of error values");
693694
CHECK_LE(env->last_error.error_code, napi_callback_scope_mismatch);
694695

0 commit comments

Comments
 (0)