Title: debug.traceback failed on anonymous function · Issue #1665 · TypeScriptToLua/TypeScriptToLua · GitHub
Open Graph Title: debug.traceback failed on anonymous function · Issue #1665 · TypeScriptToLua/TypeScriptToLua
X Title: debug.traceback failed on anonymous function · Issue #1665 · TypeScriptToLua/TypeScriptToLua
Description: TypeScriptToLua/src/lualib/SourceMapTraceBack.ts Line 52 in 1ed3b4d 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 ...
Open Graph Description: TypeScriptToLua/src/lualib/SourceMapTraceBack.ts Line 52 in 1ed3b4d let [result] = string.gsub(trace, "(%S+)%.lua:(%d+)", (file, line) => When anonymous functions are included in TS code, stack.tra...
X Description: TypeScriptToLua/src/lualib/SourceMapTraceBack.ts Line 52 in 1ed3b4d let [result] = string.gsub(trace, "(%S+)%.lua:(%d+)", (file, line) => When anonymous functions are included in TS co...
Opengraph URL: https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1665
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"debug.traceback failed on anonymous function","articleBody":"https://github.com/TypeScriptToLua/TypeScriptToLua/blob/1ed3b4d5f9968e821d10c9e6742c3b1025561495/src/lualib/SourceMapTraceBack.ts#L52\n\nWhen 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 \u003cSOME_PATH\\dist\\main.lua:65\u003e`.\nThis is because the \"\u003c\" escapes as a non-whitespace character matching the `%S`, causing it to be considered part of the path.\n\nOn Windows, you can quickly fix this by changing the pattern to `([^%s\u003c]+)%.lua:(%d+)`.\nThis isn't the most elegant fix, considering that \"\u003c\" can be part of a filename on Unix-like systems.\n\nAdditional, my guess is that if there are spaces in the entire path, it may also cause unexpected behavior because of `%S`.\n\nHowever, collecting the paths to build a regular expression can be quite risky.\nDo you have any suggestions?","author":{"url":"https://github.com/ChouUn","@type":"Person","name":"ChouUn"},"datePublished":"2025-10-28T22:15:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1665/TypeScriptToLua/issues/1665"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f9055a0a-b6f6-279d-1c9e-b21d0f920395 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B2D8:34DEC:470029D:62E37E7:69714E1C |
| html-safe-nonce | bf6b73eda990b3320471d4278ace3d57a84a03df05ca8b38453af5fa9f8808b2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMkQ4OjM0REVDOjQ3MDAyOUQ6NjJFMzdFNzo2OTcxNEUxQyIsInZpc2l0b3JfaWQiOiIxOTAzMDMxODA2NTQ1OTcyNzY1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | bd0c187b2e9780a5d6bfe9036944001e1896b68762f2af4d4eba89e11c11ed49 |
| hovercard-subject-tag | issue:3563572631 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TypeScriptToLua/TypeScriptToLua/1665/issue_layout |
| twitter:image | https://opengraph.githubassets.com/579674829fb15c380e60f2895d6ecc188e35440da20ad2068c65bc947270dadc/TypeScriptToLua/TypeScriptToLua/issues/1665 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/579674829fb15c380e60f2895d6ecc188e35440da20ad2068c65bc947270dadc/TypeScriptToLua/TypeScriptToLua/issues/1665 |
| og:image:alt | TypeScriptToLua/src/lualib/SourceMapTraceBack.ts Line 52 in 1ed3b4d let [result] = string.gsub(trace, "(%S+)%.lua:(%d+)", (file, line) => When anonymous functions are included in TS code, stack.tra... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ChouUn |
| hostname | github.com |
| expected-hostname | github.com |
| None | da7cbccf7f40bcd9540003423d9bef63b2fe7bb0b73fc59d91b5ae5b46000c90 |
| turbo-cache-control | no-preview |
| go-import | github.com/TypeScriptToLua/TypeScriptToLua git https://github.com/TypeScriptToLua/TypeScriptToLua.git |
| octolytics-dimension-user_id | 44121206 |
| octolytics-dimension-user_login | TypeScriptToLua |
| octolytics-dimension-repository_id | 115876595 |
| octolytics-dimension-repository_nwo | TypeScriptToLua/TypeScriptToLua |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 115876595 |
| octolytics-dimension-repository_network_root_nwo | TypeScriptToLua/TypeScriptToLua |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c9e6c71b091ca750658a3b2e3c82b0b85555f788 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width