1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:17:44 +00:00

LibJS: Convert Array AOs to ThrowCompletionOr

This commit is contained in:
Idan Horowitz 2021-10-22 01:34:06 +03:00
parent 3426285738
commit db5df26841
14 changed files with 37 additions and 64 deletions

View file

@ -19,7 +19,7 @@ class Array : public Object {
JS_OBJECT(Array, Object);
public:
static Array* create(GlobalObject&, size_t length, Object* prototype = nullptr);
static ThrowCompletionOr<Array*> create(GlobalObject&, size_t length, Object* prototype = nullptr);
static Array* create_from(GlobalObject&, Vector<Value> const&);
// Non-standard but equivalent to CreateArrayFromList.
template<typename T>
@ -46,7 +46,7 @@ public:
[[nodiscard]] bool length_is_writable() const { return m_length_writable; };
private:
bool set_length(PropertyDescriptor const&);
ThrowCompletionOr<bool> set_length(PropertyDescriptor const&);
bool m_length_writable { true };
};