我想重写一个函数来检查它的参数值,但是调用它并正常传递原始参数。这可能吗?我正在使用 www.coronalabs.com 的 Corona SDK
我目前不起作用的代码是:
-- getting a refrence to the original function so i can replace it with my overriding function
local newcircle = display.newCircle
-- my override
display.newCircle = function(...)
-- attempt to pass the parameters to this function on to the real function
local t = {...}
newcircle(unpack(t))
end
-- calling the overridden function as if it were normal
display.newCircle( display.newGroup(), "image.png" )