Skip to content

fix(conformance): count the target of a logical assignment without wrapping it - #636

Open
aidenybai wants to merge 1 commit into
realizefrom
logical-assignment-coverage
Open

aidenybai wants to merge 1 commit into
realizefrom
logical-assignment-coverage

Conversation

@aidenybai

Copy link
Copy Markdown
Owner

The verifier counts a branch by wrapping its test in __bippyCoverage(...). For label ??= "Untitled", label ||= x and label &&= x the test is the assignment target, and wrapping a target in a call is a syntax error. So every component with a logical assignment failed to mount: DraftTitle, DraftTitleSpelledOut, SeenCounter and SeenCounterSpelledOut in conformance-repros.

The coverage transform now rewrites a counted target ??= value as (__bippyCoverage(target) ?? (target = value)), and the same for ||= and &&=. It parses a file with Babel only when a counter is followed by a logical assignment operator.

  • addCoverageCounters is split out of the Vite plugin so it can be tested directly.
  • logical-assignment-coverage.test.ts runs instrumented ??=, ||= and &&=, including a member target and one inside an expression. It checks both the result and the counted value. On the old transform it throws a SyntaxError.
  • conformance verify on logical-assignments.tsx: 4 verified, 0 counterexamples, views 10/10 covered. Before, all 4 failed to mount.

@changeset-bot

changeset-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 00a63fb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
bippy Ready Ready Preview Nov 4, 2026 3:38am UTC

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Nov 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/bippy@636

commit: 00a63fb

This branch was successfully deployed

1 active deployment
Preview – bippy — 00a63fb2 Deployed Nov 4, 2026 by vercel[bot]
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