From 015c4f788d67a36ecb27fe698aa2d0e618a46db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Sun, 23 Jul 2023 21:51:38 +0200 Subject: [PATCH] node-api: avoid macro redefinition Even though the redefinition complies with the C standard because the second definition is "effectively the same" as the first definition, it's best to avoid any redefinition. Refs: https://github.com/nodejs/node/pull/28237 Refs: https://github.com/nodejs/node/pull/30006 PR-URL: https://github.com/nodejs/node/pull/48879 Reviewed-By: Michael Dawson Reviewed-By: Vladimir Morozov Reviewed-By: Luigi Pinca --- src/js_native_api_v8.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/js_native_api_v8.h b/src/js_native_api_v8.h index f7646778311bfd..4f0fb8b3d152f7 100644 --- a/src/js_native_api_v8.h +++ b/src/js_native_api_v8.h @@ -268,14 +268,6 @@ inline napi_status napi_set_last_error(napi_env env, } \ } while (0) -#define RETURN_STATUS_IF_FALSE_WITH_PREAMBLE(env, condition, status) \ - do { \ - if (!(condition)) { \ - return napi_set_last_error( \ - (env), try_catch.HasCaught() ? napi_pending_exception : (status)); \ - } \ - } while (0) - #define CHECK_MAYBE_EMPTY_WITH_PREAMBLE(env, maybe, status) \ RETURN_STATUS_IF_FALSE_WITH_PREAMBLE((env), !((maybe).IsEmpty()), (status))