Skip to content

fix(parsers): recognize computed variable usage reads - #5218

Closed
user-github-me wants to merge 1 commit into
heygen-com:mainfrom
user-github-me:fix/variable-usage-computed-access
Closed

user-github-me wants to merge 1 commit into
heygen-com:mainfrom
user-github-me:fix/variable-usage-computed-access

Conversation

@user-github-me

Copy link
Copy Markdown
Contributor

Studio's variable usage report misses reads through window.__hyperframes["getVariables"]() and can confidently label those declarations unused. It also skips a values alias used as the computed key of another object, leaving scanIncomplete false despite the value escaping.

Recognize a literal "getVariables" member name and skip property-position identifiers only for noncomputed members. Bracket getter reads now cross-reference declared and undeclared ids like dot calls; computed-key escapes mark the existing report incomplete.

Validation:

  • Six scanner and two SDK regressions fail on main; two additional controls preserve ordinary property-name handling.
  • Full parser suite: 1,240 passed, 4 skipped, 3 todo. Full SDK suite: 593 passed.
  • Built SDK browser bundle verifies bracket/dot report equality, alias reads, and dynamic-access degradation in Chromium with no browser errors.
  • Parser/SDK builds and type checks, repository lint/format, pre-commit gates, comment checks, deletion guard, and test reachability pass.

@jrusso1020

Copy link
Copy Markdown
Collaborator

Thanks for the careful write-up. The documented ways to read variables are the dot-call forms the scanner already covers, and we haven't seen a bracket-string getter or the values object used as a computed key in real compositions, so we'd rather not grow the scanner for those cases. Happy to revisit if a real composition hits it. — Rames

@jrusso1020 jrusso1020 closed this Oct 8, 2026
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.

2 participants