Skip to content

Commit 9409def

Browse files
committed
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: nodejs#28237 Refs: nodejs#30006
1 parent b68fa59 commit 9409def

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/js_native_api_v8.h

-8
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,6 @@ inline napi_status napi_set_last_error(napi_env env,
268268
} \
269269
} while (0)
270270

271-
#define RETURN_STATUS_IF_FALSE_WITH_PREAMBLE(env, condition, status) \
272-
do { \
273-
if (!(condition)) { \
274-
return napi_set_last_error( \
275-
(env), try_catch.HasCaught() ? napi_pending_exception : (status)); \
276-
} \
277-
} while (0)
278-
279271
#define CHECK_MAYBE_EMPTY_WITH_PREAMBLE(env, maybe, status) \
280272
RETURN_STATUS_IF_FALSE_WITH_PREAMBLE((env), !((maybe).IsEmpty()), (status))
281273

0 commit comments

Comments
 (0)