mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:27:43 +00:00
LibWeb: Ignore -Wshadow in TRY_OR_RETURN_OOM()
This commit is contained in:
parent
5103e08b77
commit
c756585deb
1 changed files with 4 additions and 1 deletions
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <AK/Diagnostics.h>
|
||||||
#include <AK/FlyString.h>
|
#include <AK/FlyString.h>
|
||||||
#include <LibJS/Runtime/VM.h>
|
#include <LibJS/Runtime/VM.h>
|
||||||
#include <LibWeb/Bindings/PlatformObject.h>
|
#include <LibWeb/Bindings/PlatformObject.h>
|
||||||
|
@ -15,7 +16,9 @@ namespace Web::WebIDL {
|
||||||
|
|
||||||
#define TRY_OR_RETURN_OOM(realm, expression) \
|
#define TRY_OR_RETURN_OOM(realm, expression) \
|
||||||
({ \
|
({ \
|
||||||
auto _temporary_result = (expression); \
|
/* Ignore -Wshadow to allow nesting the macro. */ \
|
||||||
|
AK_IGNORE_DIAGNOSTIC("-Wshadow", \
|
||||||
|
auto _temporary_result = (expression)); \
|
||||||
if (_temporary_result.is_error()) { \
|
if (_temporary_result.is_error()) { \
|
||||||
VERIFY(_temporary_result.error().code() == ENOMEM); \
|
VERIFY(_temporary_result.error().code() == ENOMEM); \
|
||||||
return WebIDL::UnknownError::create(realm, "Out of memory."sv); \
|
return WebIDL::UnknownError::create(realm, "Out of memory."sv); \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue