summaryrefslogtreecommitdiff
path: root/server/src/vm/function.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/vm/function.lua')
-rw-r--r--server/src/vm/function.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/server/src/vm/function.lua b/server/src/vm/function.lua
index 2322fa70..e605e1c9 100644
--- a/server/src/vm/function.lua
+++ b/server/src/vm/function.lua
@@ -349,15 +349,19 @@ function mt:findEmmyParamByName(name)
return nil
end
+function mt:addArg(name, source, value)
+ local loc = localMgr.create(name, source, value)
+ self:saveUpvalue(name, loc)
+ self.args[#self.args+1] = loc
+end
+
function mt:createArg(vm, arg)
vm:instantSource(arg)
arg:set('arg', self)
if arg.type == 'name' then
+ vm:instantSource(arg)
local value = valueMgr.create('nil', arg)
- local loc = localMgr.create(arg[1], arg, value)
- self:saveUpvalue(arg[1], loc)
- self.args[#self.args+1] = loc
-
+ self:addArg(arg[1], arg, value)
elseif arg.type == '...' then
self._dots = createMulti()
end