Procházet zdrojové kódy

Make it possible for the e:getDispatcher() == Services.Core:getInput() idiom to work without modification, by making class __eq aware of __ptr

mcc před 13 roky
rodič
revize
3dd9145a7d
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      Bindings/Contents/LUA/API/class.lua

+ 1 - 1
Bindings/Contents/LUA/API/class.lua

@@ -353,7 +353,7 @@ function Object:class()
 end
 
 function Object:__eq__(other)
-  return rawequal(self,other)
+  return rawequal(self,other) or (self.__ptr and other.__ptr and self.__ptr == other.__ptr)
 end
 
 function Object:__newindex__(name,value)