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:
parent
5caab0148c
commit
0cf04d07aa
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue