From 1d243b86de231a837a1466f232cba8f2a82cfcbf Mon Sep 17 00:00:00 2001 From: kikito Date: Sun, 14 Feb 2010 23:37:21 +0000 Subject: [PATCH] MiddleClass: (UNTESTED) fixed __call so it calls subclass' implementation of new instead of Object.new --- MiddleClass.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MiddleClass.lua b/MiddleClass.lua index 8991832..abf98b9 100644 --- a/MiddleClass.lua +++ b/MiddleClass.lua @@ -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