Explorar o código

LibJS: Add missing comment in OrdinaryToPrimitive

Linus Groh %!s(int64=3) %!d(string=hai) anos
pai
achega
86e3840202
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      Userland/Libraries/LibJS/Runtime/Object.cpp

+ 3 - 1
Userland/Libraries/LibJS/Runtime/Object.cpp

@@ -1245,7 +1245,9 @@ ThrowCompletionOr<Value> Object::ordinary_to_primitive(Value::PreferredType pref
     if (preferred_type == Value::PreferredType::String) {
         // a. Let methodNames be « "toString", "valueOf" ».
         method_names = { vm.names.toString, vm.names.valueOf };
-    } else {
+    }
+    // 2. Else,
+    else {
         // a. Let methodNames be « "valueOf", "toString" ».
         method_names = { vm.names.valueOf, vm.names.toString };
     }