-
-
Notifications
You must be signed in to change notification settings - Fork 181
Open
Description
| let [result] = string.gsub(trace, "(%S+)%.lua:(%d+)", (file, line) => |
When anonymous functions are included in TS code, stack.traceback printing doesn't work exactly as expected, such as in the form SOME_PATH\dist\main.ts:43: in function <SOME_PATH\dist\main.lua:65>.
This is because the "<" escapes as a non-whitespace character matching the %S, causing it to be considered part of the path.
On Windows, you can quickly fix this by changing the pattern to ([^%s<]+)%.lua:(%d+).
This isn't the most elegant fix, considering that "<" can be part of a filename on Unix-like systems.
Additional, my guess is that if there are spaces in the entire path, it may also cause unexpected behavior because of %S.
However, collecting the paths to build a regular expression can be quite risky.
Do you have any suggestions?
Metadata
Metadata
Assignees
Labels
No labels