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

LibJS: Convert test_integrity_level() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-10-03 02:21:44 +01:00
parent ed5a9aa038
commit 3af559ee8a
3 changed files with 7 additions and 7 deletions

View file

@ -188,7 +188,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::is_frozen)
auto argument = vm.argument(0);
if (!argument.is_object())
return Value(true);
return Value(argument.as_object().test_integrity_level(Object::IntegrityLevel::Frozen));
return Value(TRY_OR_DISCARD(argument.as_object().test_integrity_level(Object::IntegrityLevel::Frozen)));
}
// 20.1.2.16 Object.isSealed ( O ), https://tc39.es/ecma262/#sec-object.issealed
@ -197,7 +197,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::is_sealed)
auto argument = vm.argument(0);
if (!argument.is_object())
return Value(true);
return Value(argument.as_object().test_integrity_level(Object::IntegrityLevel::Sealed));
return Value(TRY_OR_DISCARD(argument.as_object().test_integrity_level(Object::IntegrityLevel::Sealed)));
}
// 20.1.2.18 Object.preventExtensions ( O ), https://tc39.es/ecma262/#sec-object.preventextensions