mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +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
Notes:
sideshowbarker
2024-07-17 04:09:56 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/e776171d8f Pull-request: https://github.com/SerenityOS/serenity/pull/17542
1 changed files with 3 additions and 3 deletions
|
@ -2815,7 +2815,7 @@ JS_DEFINE_NATIVE_FUNCTION(@prototype_class@::entries)
|
|||
{
|
||||
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)
|
||||
|
@ -2844,14 +2844,14 @@ JS_DEFINE_NATIVE_FUNCTION(@prototype_class@::keys)
|
|||
{
|
||||
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)
|
||||
{
|
||||
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