mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:47:35 +00:00
LibJS: Convert NativeFunction::{call,construct}() to ThrowCompletionOr
Both at the same time because many of them call construct() in call() and I'm not keen on adding a bunch of temporary plumbing to turn exceptions into throw completions. Also changes the return value of construct() to Object* instead of Value as it always needs to return an object; allowing an arbitrary Value is a massive foot gun.
This commit is contained in:
parent
0881f8160f
commit
5832de62fe
99 changed files with 597 additions and 669 deletions
|
@ -30,9 +30,9 @@ void PromiseResolvingFunction::initialize(GlobalObject& global_object)
|
|||
define_direct_property(vm().names.length, Value(1), Attribute::Configurable);
|
||||
}
|
||||
|
||||
Value PromiseResolvingFunction::call()
|
||||
ThrowCompletionOr<Value> PromiseResolvingFunction::call()
|
||||
{
|
||||
return TRY_OR_DISCARD(m_native_function(vm(), global_object(), m_promise, m_already_resolved));
|
||||
return m_native_function(vm(), global_object(), m_promise, m_already_resolved);
|
||||
}
|
||||
|
||||
void PromiseResolvingFunction::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue