diff options
author | Linus Groh <mail@linusgroh.de> | 2023-01-27 21:52:18 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-01-28 00:41:18 +0000 |
commit | 24739405263734e70d6e432b3566f1aa403724c7 (patch) | |
tree | 415a3db6601641dd436eadce3a1ddf4e41133238 /Userland | |
parent | 39301cce707397a0f34580b1649cd066bed6e481 (diff) | |
download | serenity-24739405263734e70d6e432b3566f1aa403724c7.zip |
LibJS: Add spec comments to FinalizationRegistryConstructor
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp index 186bbffad9..706f293654 100644 --- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp @@ -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()) |