Skip to content

Commit 935c497

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/node#28237 Refs: nodejs/node#30006 PR-URL: nodejs/node#48879 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Vladimir Morozov <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent d43a85e commit 935c497

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

graal-nodejs/src/js_native_api_v8.h

-8
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,6 @@ inline napi_status napi_set_last_error(napi_env env,
272272
} \
273273
} while (0)
274274

275-
#define RETURN_STATUS_IF_FALSE_WITH_PREAMBLE(env, condition, status) \
276-
do { \
277-
if (!(condition)) { \
278-
return napi_set_last_error( \
279-
(env), try_catch.HasCaught() ? napi_pending_exception : (status)); \
280-
} \
281-
} while (0)
282-
283275
#define CHECK_MAYBE_EMPTY_WITH_PREAMBLE(env, maybe, status) \
284276
RETURN_STATUS_IF_FALSE_WITH_PREAMBLE((env), !((maybe).IsEmpty()), (status))
285277

0 commit comments

Comments
 (0)