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: github.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:b523c3df-187e-724f-2be9-406130ed5525 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 88D6:DB494:26B70:33C84:69717FD4 |
| html-safe-nonce | 88a38ad9d805ecc089ff943176ec56dd038d87b18adc2766fed18b6bd283364a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OEQ2OkRCNDk0OjI2QjcwOjMzQzg0OjY5NzE3RkQ0IiwidmlzaXRvcl9pZCI6Ijg3NTM5MzA0MDgwNjkwMDUyNjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 947711bc346fa1c1fa0251379e36adba383ccfe148c143060b83ae3fdb95fad0 |
| 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 | 83f241b6f7605f8428e9ff3118ca968f3a377f07904e088dfd9465a7c12cc367 |
| 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 | 742da896705f64f8f87756c8e5cc3175bdbeb85e |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width