mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add debug.get_traceback
This commit is contained in:
parent
dcd8871ee1
commit
712c0756b8
1 changed files with 14 additions and 0 deletions
|
|
@ -228,6 +228,20 @@ function file.readlines(path)
|
|||
return lines
|
||||
end
|
||||
|
||||
function debug.get_trackback()
|
||||
local frames = {}
|
||||
local n = 0
|
||||
while true do
|
||||
local info = debug.getinfo(n)
|
||||
if info then
|
||||
table.insert(frames, info)
|
||||
else
|
||||
return frames
|
||||
end
|
||||
n = n + 1
|
||||
end
|
||||
end
|
||||
|
||||
package = {
|
||||
loaded={}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue