mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
LibJS: Add spec comments to FinalizationRegistryConstructor
This commit is contained in:
parent
39301cce70
commit
2473940526
1 changed files with 2 additions and 2 deletions
|
@ -33,6 +33,8 @@ void FinalizationRegistryConstructor::initialize(Realm& realm)
|
|||
ThrowCompletionOr<Value> FinalizationRegistryConstructor::call()
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
|
||||
// 1. If NewTarget is undefined, throw a TypeError exception.
|
||||
return vm.throw_completion<TypeError>(ErrorType::ConstructorWithoutNew, vm.names.FinalizationRegistry);
|
||||
}
|
||||
|
||||
|
@ -41,8 +43,6 @@ ThrowCompletionOr<NonnullGCPtr<Object>> FinalizationRegistryConstructor::constru
|
|||
{
|
||||
auto& vm = this->vm();
|
||||
|
||||
// NOTE: Step 1 is implemented in FinalizationRegistryConstructor::call()
|
||||
|
||||
// 2. If IsCallable(cleanupCallback) is false, throw a TypeError exception.
|
||||
auto cleanup_callback = vm.argument(0);
|
||||
if (!cleanup_callback.is_function())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue