Skip to content

Commit

Permalink
src: replace assert with CHECK_LE in node_api.cc
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
bnoordhuis authored and MylesBorins committed Apr 16, 2018
1 parent 831de61 commit 0ef0b34
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/node_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#include <string.h>
#include <algorithm>
#include <cassert>
#include <cmath>
#include <vector>
#include "uv.h"
Expand Down Expand Up @@ -855,7 +854,7 @@ napi_status napi_get_last_error_info(napi_env env,
static_assert(
node::arraysize(error_messages) == napi_escape_called_twice + 1,
"Count of error messages must match count of error values");
assert(env->last_error.error_code <= napi_escape_called_twice);
CHECK_LE(env->last_error.error_code, napi_escape_called_twice);

// Wait until someone requests the last error information to fetch the error
// message string
Expand Down

0 comments on commit 0ef0b34

Please sign in to comment.