Skip to content

Commit 0ef0b34

Browse files
bnoordhuisMylesBorins
authored andcommittedApr 16, 2018
src: replace assert with CHECK_LE in node_api.cc
Backport-PR-URL: #19447 PR-URL: #14514 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Tobias Nie�en <tniessen@tnie.de>
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)