Преглед на файлове

LibJS: Add spec comments to FinalizationRegistryConstructor

Linus Groh преди 2 години
родител
ревизия
2473940526
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp

+ 2 - 2
Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp

@@ -33,6 +33,8 @@ void FinalizationRegistryConstructor::initialize(Realm& realm)
 ThrowCompletionOr<Value> FinalizationRegistryConstructor::call()
 ThrowCompletionOr<Value> FinalizationRegistryConstructor::call()
 {
 {
     auto& vm = this->vm();
     auto& vm = this->vm();
+
+    // 1. If NewTarget is undefined, throw a TypeError exception.
     return vm.throw_completion<TypeError>(ErrorType::ConstructorWithoutNew, vm.names.FinalizationRegistry);
     return vm.throw_completion<TypeError>(ErrorType::ConstructorWithoutNew, vm.names.FinalizationRegistry);
 }
 }
 
 
@@ -41,8 +43,6 @@ ThrowCompletionOr<NonnullGCPtr<Object>> FinalizationRegistryConstructor::constru
 {
 {
     auto& vm = this->vm();
     auto& vm = this->vm();
 
 
-    // NOTE: Step 1 is implemented in FinalizationRegistryConstructor::call()
-
     // 2. If IsCallable(cleanupCallback) is false, throw a TypeError exception.
     // 2. If IsCallable(cleanupCallback) is false, throw a TypeError exception.
     auto cleanup_callback = vm.argument(0);
     auto cleanup_callback = vm.argument(0);
     if (!cleanup_callback.is_function())
     if (!cleanup_callback.is_function())