mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 18:46:18 +00:00
LibWeb: Allow prototype.{entries keys,value} to propagate errors
This allows the prototype.{entries keys,value} native functions generated by the BindingsGenerator to propagate errors if needed.
This commit is contained in:
parent
1f48081ee4
commit
e776171d8f
|
@ -2815,7 +2815,7 @@ JS_DEFINE_NATIVE_FUNCTION(@prototype_class@::entries)
|
||||||
{
|
{
|
||||||
auto* impl = TRY(impl_from(vm));
|
auto* impl = TRY(impl_from(vm));
|
||||||
|
|
||||||
return @iterator_name@::create(*impl, Object::PropertyKind::KeyAndValue).ptr();
|
return TRY(throw_dom_exception_if_needed(vm, [&] { return @iterator_name@::create(*impl, Object::PropertyKind::KeyAndValue); }));
|
||||||
}
|
}
|
||||||
|
|
||||||
JS_DEFINE_NATIVE_FUNCTION(@prototype_class@::for_each)
|
JS_DEFINE_NATIVE_FUNCTION(@prototype_class@::for_each)
|
||||||
|
@ -2844,14 +2844,14 @@ JS_DEFINE_NATIVE_FUNCTION(@prototype_class@::keys)
|
||||||
{
|
{
|
||||||
auto* impl = TRY(impl_from(vm));
|
auto* impl = TRY(impl_from(vm));
|
||||||
|
|
||||||
return @iterator_name@::create(*impl, Object::PropertyKind::Key).ptr();
|
return TRY(throw_dom_exception_if_needed(vm, [&] { return @iterator_name@::create(*impl, Object::PropertyKind::Key); }));
|
||||||
}
|
}
|
||||||
|
|
||||||
JS_DEFINE_NATIVE_FUNCTION(@prototype_class@::values)
|
JS_DEFINE_NATIVE_FUNCTION(@prototype_class@::values)
|
||||||
{
|
{
|
||||||
auto* impl = TRY(impl_from(vm));
|
auto* impl = TRY(impl_from(vm));
|
||||||
|
|
||||||
return @iterator_name@::create(*impl, Object::PropertyKind::Value).ptr();
|
return TRY(throw_dom_exception_if_needed(vm, [&] { return @iterator_name@::create(*impl, Object::PropertyKind::Value); }));
|
||||||
}
|
}
|
||||||
)~~~");
|
)~~~");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue