mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:47:46 +00:00
LibJS: Replace the boolean argument of Object::set with an enum class
This is more serenity-esque and also makes pointing out missing exception checks during reviews much easier.
This commit is contained in:
parent
4b39e718b3
commit
8d01d43f5e
17 changed files with 73 additions and 66 deletions
|
@ -46,6 +46,11 @@ public:
|
|||
Frozen,
|
||||
};
|
||||
|
||||
enum class ShouldThrowExceptions {
|
||||
No,
|
||||
Yes,
|
||||
};
|
||||
|
||||
// Please DO NOT make up your own non-standard methods unless you
|
||||
// have a very good reason to do so. If any object abstract
|
||||
// operation from the spec is missing, add it instead.
|
||||
|
@ -69,7 +74,7 @@ public:
|
|||
// 7.3 Operations on Objects, https://tc39.es/ecma262/#sec-operations-on-objects
|
||||
|
||||
Value get(PropertyName const&) const;
|
||||
bool set(PropertyName const&, Value, bool throw_exceptions);
|
||||
bool set(PropertyName const&, Value, ShouldThrowExceptions);
|
||||
bool create_data_property(PropertyName const&, Value);
|
||||
bool create_method_property(PropertyName const&, Value);
|
||||
bool create_data_property_or_throw(PropertyName const&, Value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue