MiddleClass: (UNTESTED) fixed __call so it calls subclass' implementation of new instead of Object.new

This commit is contained in:
kikito 2010-02-14 23:37:21 +00:00
parent e06b0c16d7
commit 1d243b86de

View File

@ -49,7 +49,7 @@ Object.subclass = function(superclass, name)
rawset(classDict, methodName, method) rawset(classDict, methodName, method)
end, end,
__tostring = function() return ("class ".. name) end, __tostring = function() return ("class ".. name) end,
__call = Object.new __call = function(_, ...) return theClass:new(...) end
}) })
-- instance methods go after the setmetatable, so we can use "super" -- instance methods go after the setmetatable, so we can use "super"
theClass.initialize = function(instance,...) super.initialize(instance) end theClass.initialize = function(instance,...) super.initialize(instance) end