1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

LibJS: Temporarily clear exception in Object::get_without_side_effects()

This would return an empty value once it hits an exception check
otherwise. Considering that this mostly is used in situations where we
already *do* have an exception (traceback printing, for example), let's
make this easier for ourselves to use.
This commit is contained in:
Linus Groh 2021-04-24 17:59:28 +02:00 committed by Andreas Kling
parent 5caab0148c
commit 0cf04d07aa

View file

@ -19,6 +19,7 @@
#include <LibJS/Runtime/Object.h>
#include <LibJS/Runtime/Shape.h>
#include <LibJS/Runtime/StringObject.h>
#include <LibJS/Runtime/TemporaryClearException.h>
#include <LibJS/Runtime/Value.h>
namespace JS {
@ -789,6 +790,7 @@ Value Object::get(const PropertyName& property_name, Value receiver, bool withou
Value Object::get_without_side_effects(const PropertyName& property_name) const
{
TemporaryClearException clear_exception(vm());
return get(property_name, {}, true);
}