fix debug.traceback failing on anonymous function (#1665)#1666
Merged
Perryvw merged 4 commits intoTypeScriptToLua:masterfrom Mar 3, 2026
Merged
fix debug.traceback failing on anonymous function (#1665)#1666Perryvw merged 4 commits intoTypeScriptToLua:masterfrom
debug.traceback failing on anonymous function (#1665)#1666Perryvw merged 4 commits intoTypeScriptToLua:masterfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in the source map traceback regex pattern to avoid incorrectly matching anonymous function stack entries. The regex is updated to exclude the < character from file path matching, preventing matches against patterns like in function <...> that appear in Lua stack traces.
- Updated regex pattern from
(%S+)to([^%s<]+)to exclude<character - Added comprehensive comments explaining the fix and its limitations
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ypeScriptToLua#1665) Nested IIFEs produce <file.lua:N> notation in debug.traceback(). The old pattern (%S+) captured the "<" prefix, causing sourcemap lookup to fail for anonymous function definition locations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Perryvw
reviewed
Feb 28, 2026
…ypeScriptToLua#1665) Use distinct sourcemap values and explicit <main.ts:N> assertions per reviewer request. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
more details in #1665