diff --git a/shell/platform/ohos/napi_common.h b/shell/platform/ohos/napi_common.h index c6e468d80b1c853878599c7129df595501709432..7ce06c7246f5034d4a18af406977ab1d40c6fb2b 100644 --- a/shell/platform/ohos/napi_common.h +++ b/shell/platform/ohos/napi_common.h @@ -15,18 +15,18 @@ #define NAPI_RETVAL_NOTHING -#define GET_AND_THROW_LAST_ERROR(env) \ - do { \ - const napi_extended_error_info* errorInfo = nullptr; \ - napi_get_last_error_info((env), &errorInfo); \ - bool isPending = false; \ - napi_is_exception_pending((env), &isPending); \ - if (!isPending && errorInfo != nullptr) { \ - const char* errorMessage = errorInfo->error_message != nullptr \ - ? errorInfo->error_message \ - : "empty error message"; \ - napi_throw_error((env), nullptr, errorMessage); \ - } \ +#define GET_AND_THROW_LAST_ERROR(env) \ + do { \ + const napi_extended_error_info* error_Info = nullptr; \ + napi_get_last_error_info((env), &error_Info); \ + bool isPending = false; \ + napi_is_exception_pending((env), &isPending); \ + if (!isPending && error_Info != nullptr) { \ + const char* errorMessage = error_Info->error_message != nullptr \ + ? error_Info->error_message \ + : "empty error message"; \ + napi_throw_error((env), nullptr, errorMessage); \ + } \ } while (0) #define NAPI_ASSERT_BASE(env, assertion, message, retVal) \ @@ -44,12 +44,12 @@ #define NAPI_ASSERT_RETURN_VOID(env, assertion, message) \ NAPI_ASSERT_BASE(env, assertion, message, NAPI_RETVAL_NOTHING) -#define NAPI_CALL_BASE(env, theCall, retVal) \ - do { \ - if ((theCall) != napi_ok) { \ - GET_AND_THROW_LAST_ERROR((env)); \ - return retVal; \ - } \ +#define NAPI_CALL_BASE(env, theCall, retValue) \ + do { \ + if ((theCall) != napi_ok) { \ + GET_AND_THROW_LAST_ERROR((env)); \ + return retValue; \ + } \ } while (0) #define NAPI_CALL(env, theCall) NAPI_CALL_BASE(env, theCall, nullptr)