summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-10-20 21:16:30 +0100
committerLinus Groh <mail@linusgroh.de>2021-10-21 09:02:23 +0100
commit5832de62fe5e2de4f9a65485246df6550aece33f (patch)
tree485f847a4dedebdcb2b11902bbe0256fa98518ed /Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h
parent0881f8160fd81d8e25b7cc2eff2d64f2aed7ed53 (diff)
downloadserenity-5832de62fe5e2de4f9a65485246df6550aece33f.zip
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.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h')
-rw-r--r--Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h b/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h
index df71a2b69f..bb7a733e0a 100644
--- a/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h
+++ b/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h
@@ -18,8 +18,8 @@ public:
virtual void initialize(GlobalObject&) override;
virtual ~WeakMapConstructor() override;
- virtual Value call() override;
- virtual Value construct(FunctionObject&) override;
+ virtual ThrowCompletionOr<Value> call() override;
+ virtual ThrowCompletionOr<Object*> construct(FunctionObject&) override;
private:
virtual bool has_constructor() const override { return true; }