Repository navigation
[TS] Prepare dynamic string contents before truthiness and equality - #531
Open
CaelmBleidd wants to merge 3 commits into
Open
CaelmBleidd wants to merge 3 commits into
CaelmBleidd wants to merge 3 commits into
Conversation
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.
A dynamic
any/unknownstring used inif (value)or direct equality previously stopped as unsupported before it could produce an empty/nonempty or equal/unequal witness. Prepare bounded UTF-16 backing when the runtime string alternative is selected, retaining the feasible non-string/nullish alternative as a separate state. Construct truthiness only after backing preparation, including logical operators and Boolean conversion.String bounds use the existing machine setting. Non-string references receive no string backing or added string constraints. Application/model selection does not affect this runtime behavior.
Validation: 31 focused tests passed; 2 existing TypeCoercion tests skipped. Strict
:usvm-ts:detektMainanddetektTestpassed. Generated dynamic truthiness/equality witnesses replay in Node. All 3 new/strengthened regressions fail against the unchanged base for the intended missing-string behavior; restoring the patch passes. Full suites remain for CI/final integration.Follow-up validation: null/undefined comparisons bypass content preparation; other comparisons prepare backing only under an active non-nullish string/string guard. The unchanged Undefined regression and a source object-equality/type-refinement scenario retain string, null, undefined and other inputs. Latest focused run: 29 tests passed, no skips, strict Detekt passed; generated witnesses replay in Node.