diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/src/vm/value.lua | 20 | ||||
-rw-r--r-- | server/test/definition/table.lua | 6 |
2 files changed, 4 insertions, 22 deletions
diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua index 0b163c3f..0f2a8193 100644 --- a/server/src/vm/value.lua +++ b/server/src/vm/value.lua @@ -167,15 +167,9 @@ function mt:mergeValue(value) self._child[k] = v end end - if value._info then - if not self._info then - self._info = {} - end - for _, info in ipairs(value._info) do - self._info[#self._info+1] = info - end + for _, info in ipairs(value) do + self[#self+1] = info end - value._info = self._info if value._meta then self._meta = value._meta end @@ -191,20 +185,14 @@ function mt:addInfo(tp, source) if source and not source.start then error('Miss start: ' .. table.dump(source)) end - if not self._info then - self._info = {} - end - self._info[#self._info+1] = { + self[#self+1] = { type = tp, source = source or getDefaultSource(), } end function mt:eachInfo(callback) - if not self._info then - return - end - for _, info in ipairs(self._info) do + for _, info in ipairs(self) do local res = callback(info) if res ~= nil then return res diff --git a/server/test/definition/table.lua b/server/test/definition/table.lua index 23af390d..bafa755c 100644 --- a/server/test/definition/table.lua +++ b/server/test/definition/table.lua @@ -90,12 +90,6 @@ t { ]] TEST[[ -local t -t.<?after?>() -t.<!after!> = a -]] - -TEST[[ local t = { <!insert!> = 1, } |