[pull] canary from vercel:canary#1083
Merged
Merged
Conversation
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.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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 : )