Skip to content

Commit

Permalink
More upvalues
Browse files Browse the repository at this point in the history
  • Loading branch information
lL1l1 committed Dec 22, 2024
1 parent 106837b commit 8d6d337
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lua/system/repr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,19 @@ local tostring = tostring
local rep = string.rep
local flr = math.floor
local match = string.match
local substr = string.sub
local gsub = string.gsub
local fmt = string.format
local _rawget = rawget
local type = type
local getmetatable = getmetatable
local debugGetInfo = debug.getinfo

local TableSort = table.sort
local TableEmpty = table.empty

local DiskToLocal = DiskToLocal

---@param t table
---@return function
---@return table
Expand Down Expand Up @@ -187,8 +191,8 @@ function Inspector:getId(v)
id = (ids[tv] or 0) + 1
ids[tv] = id
if tv == "function" then
local info = debug.getinfo(v, "S")
id = fmt("%s %s(%d)", id, DiskToLocal(string.sub(info.source, 2)--[[@as FileName]]), info.linedefined)
local info = debugGetInfo(v, "S")
id = fmt("%s %s(%d)", id, DiskToLocal(substr(info.source, 2)--[[@as FileName]]), info.linedefined)
end
ids[v] = id
end
Expand Down

0 comments on commit 8d6d337

Please sign in to comment.