From faead2bc3d7699666279974692a55b71423f07c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 26 Feb 2019 17:10:36 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=AD=A3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/vm/vm.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'server/src/vm') diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua index d8905538..049294dd 100644 --- a/server/src/vm/vm.lua +++ b/server/src/vm/vm.lua @@ -360,6 +360,7 @@ function mt:getName(name, source) return global else global = self:createValue('any') + ENVValue:setChild(name, global) return global end end @@ -723,12 +724,13 @@ function mt:setOne(var, value) value = createValue('nil') end self:instantSource(var) - var:bindValue(value, 'set') if var.type == 'name' then self:setName(var[1], var, value) + var:bindValue(value, 'set') elseif var.type == 'simple' then local parent = self:getSimple(var, -2) local key = var[#var] + self:instantSource(key) if key.type == 'index' then local index = self:getIndex(key[1]) parent:setChild(index, value) @@ -736,6 +738,7 @@ function mt:setOne(var, value) local index = key[1] parent:setChild(index, value) end + key:bindValue(value, 'set') end end -- cgit v1.2.3