Просмотр исходного кода

LibJS: Fix compilation of operator= for JS::SafeFunction

operator= for JS::SafeFunction was missing the CallableKind parameter
in the call to init_with_callable. This was not picked up before as
nothing used operator= on JS::SafeFunction.
Luke Wilde 2 лет назад
Родитель
Сommit
4bc0d8e4c8
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      Userland/Libraries/LibJS/SafeFunction.h

+ 2 - 2
Userland/Libraries/LibJS/SafeFunction.h

@@ -88,7 +88,7 @@ public:
     requires((AK::IsFunctionObject<CallableType> && IsCallableWithArguments<CallableType, Out, In...>))
     requires((AK::IsFunctionObject<CallableType> && IsCallableWithArguments<CallableType, Out, In...>))
     {
     {
         clear();
         clear();
-        init_with_callable(forward<CallableType>(callable));
+        init_with_callable(forward<CallableType>(callable), CallableKind::FunctionObject);
         return *this;
         return *this;
     }
     }
 
 
@@ -98,7 +98,7 @@ public:
     {
     {
         clear();
         clear();
         if (f)
         if (f)
-            init_with_callable(move(f));
+            init_with_callable(move(f), CallableKind::FunctionPointer);
         return *this;
         return *this;
     }
     }