mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 00:57:43 +00:00
LibJS: Convert internal_prevent_extensions() to ThrowCompletionOr
This commit is contained in:
parent
9b4362f10a
commit
73bae7d779
12 changed files with 22 additions and 30 deletions
|
@ -301,9 +301,7 @@ bool Object::set_integrity_level(IntegrityLevel level)
|
|||
VERIFY(level == IntegrityLevel::Sealed || level == IntegrityLevel::Frozen);
|
||||
|
||||
// 3. Let status be ? O.[[PreventExtensions]]().
|
||||
auto status = internal_prevent_extensions();
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto status = TRY_OR_DISCARD(internal_prevent_extensions());
|
||||
|
||||
// 4. If status is false, return false.
|
||||
if (!status)
|
||||
|
@ -554,7 +552,7 @@ ThrowCompletionOr<bool> Object::internal_is_extensible() const
|
|||
}
|
||||
|
||||
// 10.1.4 [[PreventExtensions]] ( ), https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-preventextensions
|
||||
bool Object::internal_prevent_extensions()
|
||||
ThrowCompletionOr<bool> Object::internal_prevent_extensions()
|
||||
{
|
||||
// 1. Set O.[[Extensible]] to false.
|
||||
m_is_extensible = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue