mirror of
https://github.com/kikito/middleclass.git
synced 2024-11-08 09:34:22 +00:00
MiddleClass: (UNTESTED) fixed __call so it calls subclass' implementation of new instead of Object.new
This commit is contained in:
parent
e06b0c16d7
commit
1d243b86de
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user