Skip to content

Reject on empty fields object in PlainYearMonth::with#626

Merged
nekevss merged 2 commits intomainfrom
fix-pym-with-bug
Nov 13, 2025
Merged

Reject on empty fields object in PlainYearMonth::with#626
nekevss merged 2 commits intomainfrom
fix-pym-with-bug

Conversation

@nekevss
Copy link
Member

@nekevss nekevss commented Nov 12, 2025

Small fix for a bug in PlainYearMonth::with.

This can still be handled downstream in the engines, if there is careful attention to the specification steps. We should still reject here to fix bug in Rust API.

@nekevss nekevss requested a review from Manishearth November 12, 2025 23:52
@nekevss nekevss added the C-bug Something isn't working label Nov 12, 2025
@Manishearth
Copy link
Contributor

Confirming that V8 is free from this bug.

d8> a = Temporal.PlainYearMonth.from({year: 2025, month: 1})
2025-01
d8> a.with({})
(d8):1: TypeError: Temporal error: Must specify at least one calendar field.
a.with({})

Is there a test262 test for this? Should there be?

@nekevss
Copy link
Member Author

nekevss commented Nov 12, 2025

@nekevss
Copy link
Member Author

nekevss commented Nov 13, 2025

See boa-dev/boa#4530 for reference

@Manishearth
Copy link
Contributor

Fair enough!

@nekevss nekevss merged commit 9d71d88 into main Nov 13, 2025
8 checks passed
@nekevss nekevss deleted the fix-pym-with-bug branch December 21, 2025 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants