Skip to content

Commit 0ef0b34

Browse files
bnoordhuisMylesBorins
authored andcommitted
src: replace assert with CHECK_LE in node_api.cc
Backport-PR-URL: #19447 PR-URL: #14514 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Tobias Nie�en <[email protected]>
1 parent 831de61 commit 0ef0b34

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/node_api.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
#include <string.h>
1515
#include <algorithm>
16-
#include <cassert>
1716
#include <cmath>
1817
#include <vector>
1918
#include "uv.h"
@@ -855,7 +854,7 @@ napi_status napi_get_last_error_info(napi_env env,
855854
static_assert(
856855
node::arraysize(error_messages) == napi_escape_called_twice + 1,
857856
"Count of error messages must match count of error values");
858-
assert(env->last_error.error_code <= napi_escape_called_twice);
857+
CHECK_LE(env->last_error.error_code, napi_escape_called_twice);
859858

860859
// Wait until someone requests the last error information to fetch the error
861860
// message string

0 commit comments

Comments
 (0)