From 0ef0b342e9d849e7314dac3cf28628e4ca9b5648 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 27 Jul 2017 17:33:35 +0200 Subject: [PATCH] src: replace assert with CHECK_LE in node_api.cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14514 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Jason Ginchereau Reviewed-By: Refael Ackermann Reviewed-By: Richard Lau Reviewed-By: Timothy Gu Reviewed-By: Tobias Nie�en --- src/node_api.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/node_api.cc b/src/node_api.cc index 08bbede084c97b..932ec858963558 100644 --- a/src/node_api.cc +++ b/src/node_api.cc @@ -13,7 +13,6 @@ #include #include -#include #include #include #include "uv.h" @@ -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