From cd2b60b101a398cb9356d746364e70eaed1860f1 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Mon, 22 Jun 2020 16:50:40 +0800 Subject: add support for local variable declared with attribute 'close' and 'const' for Lua 5.4. --- src/MoonP/stacktraceplus.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/MoonP/stacktraceplus.h') diff --git a/src/MoonP/stacktraceplus.h b/src/MoonP/stacktraceplus.h index 3d32322..d658c5c 100644 --- a/src/MoonP/stacktraceplus.h +++ b/src/MoonP/stacktraceplus.h @@ -406,8 +406,8 @@ function _M.stacktrace(thread, message, level) end end if fname then - fname = fname:gsub("%[string \"", "") - fname = fname:gsub("\"%]", "") + local fn = fname:match("%[string \"(.-)\"%]") + if fn then fname = fn end fname = fname:gsub("^%s*(.-)%s*$", "%1") fname, line = getMoonLineNumber(fname, line) if _M.simplified then -- cgit v1.2.3-55-g6feb