mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +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
Notes:
sideshowbarker
2024-07-18 02:06:32 +09:00
Author: https://github.com/linusg
Commit: 5832de62fe
Pull-request: https://github.com/SerenityOS/serenity/pull/10548
Reviewed-by: https://github.com/IdanHo ✅
99 changed files with 597 additions and 669 deletions
|
@ -19,8 +19,8 @@ public:
|
|||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~GeneratorFunctionConstructor() override;
|
||||
|
||||
virtual Value call() override;
|
||||
virtual Value construct(FunctionObject& new_target) override;
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
bool has_constructor() const override { return true; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue