mirror of
https://github.com/kikito/middleclass.git
synced 2024-11-25 02:44:20 +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)
|
||||
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"
|
||||
theClass.initialize = function(instance,...) super.initialize(instance) end
|
||||
|
Loading…
Reference in New Issue
Block a user