Skip to content

[pull] canary from vercel:canary#1083

Merged
pull[bot] merged 2 commits into
code:canaryfrom
vercel:canary
May 29, 2026
Merged

[pull] canary from vercel:canary#1083
pull[bot] merged 2 commits into
code:canaryfrom
vercel:canary

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 29, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

sampoder and others added 2 commits May 28, 2026 19:50
Originally this PR was a comment fix that was flagged by @bgw's Claude:

```

  ▎ "Otherwise returns None."

  The function actually returns item_value(last_item) when no element matches.
  Comment doesn't describe behavior.

  ---
  The two most consequential bugs are #1 (swapped AND/OR predicates) and #2 
  (regex). #1 silently produces wrong nullishness/string-ness results for any
  code path that asks about &&/|| chains and feeds into linker decisions; #2
  silently corrupts every default-filter require.context resolution.
``` 

Related to #94159, updates the comment to say that it returns the last
item.

Which appears to be what is happening:

```rust
if it.peek().is_none() {
    return item_value(item);
} 
```

Afterwards, it now includes a reworking of `shortcircuit_if_known` into
`eval_shortcircuit()`:
#94163 (comment)
This is another thing flagged by @bgw's Claude:

```
  3. Dead duplicate match arm in is_truthy for StrictEqual (lines 2469–2494)

  ( … StrictEqual, Constant(a), Constant(b)) if a.is_value_type() => Some(a ==
  b),
  ( … StrictEqual, Constant(a), Constant(b)) if a.is_value_type() => { /* 
  same-type check */ }

  Identical pattern + guard. The second arm — the only one that handles
  cross-type equality conservatively — is unreachable. Looks like a half-applied
   fix.
``` 

I've removed the second arm with a double type check. Tests appear to
still pass and I can't think of a case where we'd hit the second arm.
@pull pull Bot locked and limited conversation to collaborators May 29, 2026
@pull pull Bot added the ⤵️ pull label May 29, 2026
@pull pull Bot merged commit 4182938 into code:canary May 29, 2026
1 of 3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant