execute params fix

This commit is contained in:
BuckarooBanzay 2023-04-20 10:51:59 +02:00
parent c1b6439938
commit 51bb937344
3 changed files with 7 additions and 4 deletions

View File

@ -1,7 +1,7 @@
function mtscad.Context:execute(fn, ...)
local params = ...
local params = {...}
local ctx = self:clone()
self.job_context.enqueue(function() fn(ctx, params) end)
self.job_context.enqueue(function() fn(ctx, unpack(params)) end)
return self
end

View File

@ -1,6 +1,9 @@
local another_lib = mtscad.load_module("another_lib/another_lib")
return function(ctx)
return function(ctx, a, b, c)
assert(a == 1)
assert(b == 2)
assert(c == 3)
ctx:execute(another_lib)
end

View File

@ -2,5 +2,5 @@
local mylib = mtscad.load_module("lib/mylib")
return function(ctx)
ctx:execute(mylib)
ctx:execute(mylib, 1, 2, 3)
end, {success=true}