Skip to content

[TS] Prepare dynamic string contents before truthiness and equality - #531

Open
CaelmBleidd wants to merge 3 commits into
mainfrom
caelmbleidd/dynamic-string-runtime
Open

CaelmBleidd wants to merge 3 commits into
mainfrom
caelmbleidd/dynamic-string-runtime

Conversation

@CaelmBleidd

@CaelmBleidd CaelmBleidd commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

A dynamic any/unknown string used in if (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:detektMain and detektTest passed. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant