Add posibility to pass args to called-functions in dispatcher
authorSteven Barth <steven@midlink.org>
Sun, 26 Oct 2008 18:55:54 +0000 (18:55 +0000)
committerSteven Barth <steven@midlink.org>
Sun, 26 Oct 2008 18:55:54 +0000 (18:55 +0000)
libs/web/luasrc/dispatcher.lua

index d199d41e4c951332e0cbd75162784120f2131acd..d58987a3f2f4a5ec394f1bd73646e428c8e2da3f 100644 (file)
@@ -469,7 +469,13 @@ end
 -- @param      ...             Additional parameters passed to the function
 function call(name, ...)
        local argv = {...}
-       return function() return getfenv()[name](unpack(argv)) end
+       return function(...)
+               if #argv > 0 then 
+                       return getfenv()[name](unpack(argv), ...)
+               else
+                       return getfenv()[name](...)
+               end
+       end
 end
 
 --- Create a template render dispatching target.