From 8d6d3373be6cc49152d2d0fc41a588fb787e81b8 Mon Sep 17 00:00:00 2001 From: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Sun, 22 Dec 2024 00:35:07 -0800 Subject: [PATCH] More upvalues --- lua/system/repr.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/system/repr.lua b/lua/system/repr.lua index f0bedb5eef..06483a8df6 100644 --- a/lua/system/repr.lua +++ b/lua/system/repr.lua @@ -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 @@ -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