Skip to content

Fixed getClosestExpression bug to return undefined when position not found#1433

Merged
TwitchBronBron merged 1 commit intomasterfrom
bugfix/issue-with-closest-epression-with-missing-position
Mar 20, 2025
Merged

Fixed getClosestExpression bug to return undefined when position not found#1433
TwitchBronBron merged 1 commit intomasterfrom
bugfix/issue-with-closest-epression-with-missing-position

Conversation

@chrisdp
Copy link
Contributor

@chrisdp chrisdp commented Mar 20, 2025

Fixed a bug in BrsFile.getClosestExpression() that was returning the last expression in the AST when given an undefined position. Now we return undefined if the position or position.line is undefined, which should make more sense and also save a little processing time because we can exit early instead of traversing the entire AST tree

@chrisdp chrisdp added the bug Something isn't working label Mar 20, 2025
@TwitchBronBron TwitchBronBron changed the title Fxied a bug where getClosestExpression would return the last expressi… Fixed getClosestExpression bug to return undefined when position not found Mar 20, 2025
@TwitchBronBron TwitchBronBron merged commit 596c3dc into master Mar 20, 2025
6 checks passed
@TwitchBronBron TwitchBronBron deleted the bugfix/issue-with-closest-epression-with-missing-position branch March 20, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants