summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Object.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-10-03 02:21:44 +0100
committerLinus Groh <mail@linusgroh.de>2021-10-03 20:14:03 +0100
commit3af559ee8a3f2a2a170496e2f46d7caf3439befb (patch)
treed2db6eaa1acae0649cb0806039bf95bc320d1ac2 /Userland/Libraries/LibJS/Runtime/Object.cpp
parented5a9aa03850294d7b0280d58ed08f76c606e25c (diff)
downloadserenity-3af559ee8a3f2a2a170496e2f46d7caf3439befb.zip
LibJS: Convert test_integrity_level() to ThrowCompletionOr
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Object.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Object.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Object.cpp b/Userland/Libraries/LibJS/Runtime/Object.cpp
index 2bc19b33a1..60afb0a7e7 100644
--- a/Userland/Libraries/LibJS/Runtime/Object.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Object.cpp
@@ -340,7 +340,7 @@ ThrowCompletionOr<bool> Object::set_integrity_level(IntegrityLevel level)
}
// 7.3.16 TestIntegrityLevel ( O, level ), https://tc39.es/ecma262/#sec-testintegritylevel
-bool Object::test_integrity_level(IntegrityLevel level) const
+ThrowCompletionOr<bool> Object::test_integrity_level(IntegrityLevel level) const
{
// 1. Assert: Type(O) is Object.
@@ -348,7 +348,7 @@ bool Object::test_integrity_level(IntegrityLevel level) const
VERIFY(level == IntegrityLevel::Sealed || level == IntegrityLevel::Frozen);
// 3. Let extensible be ? IsExtensible(O).
- auto extensible = TRY_OR_DISCARD(is_extensible());
+ auto extensible = TRY(is_extensible());
// 4. If extensible is true, return false.
// 5. NOTE: If the object is extensible, none of its properties are examined.
@@ -356,14 +356,14 @@ bool Object::test_integrity_level(IntegrityLevel level) const
return false;
// 6. Let keys be ? O.[[OwnPropertyKeys]]().
- auto keys = TRY_OR_DISCARD(internal_own_property_keys());
+ auto keys = TRY(internal_own_property_keys());
// 7. For each element k of keys, do
for (auto& key : keys) {
auto property_name = PropertyName::from_value(global_object(), key);
// a. Let currentDesc be ? O.[[GetOwnProperty]](k).
- auto current_descriptor = TRY_OR_DISCARD(internal_get_own_property(property_name));
+ auto current_descriptor = TRY(internal_get_own_property(property_name));
// b. If currentDesc is not undefined, then
if (!current_descriptor.has_value())