subclass's __instanceDict.__index should be a table if there is no custom __index

This commit is contained in:
Chao Yin 2019-10-18 18:49:15 +08:00
parent 6102f676c2
commit fd25b1a006

View File

@ -147,8 +147,10 @@ local DefaultMixin = {
local subclass = _createClass(name, self) local subclass = _createClass(name, self)
for methodName, f in pairs(self.__instanceDict) do for methodName, f in pairs(self.__instanceDict) do
if not (methodName == "__index" and type(f) == "table") then
_propagateInstanceMethod(subclass, methodName, f) _propagateInstanceMethod(subclass, methodName, f)
end end
end
subclass.initialize = function(instance, ...) return self.initialize(instance, ...) end subclass.initialize = function(instance, ...) return self.initialize(instance, ...) end
self.subclasses[subclass] = true self.subclasses[subclass] = true