Skip to content

Ensure the same object is not passed twice into user code #1686

@ptomato

Description

@ptomato

While investigating #1685, I discovered that there are a few instances of the problem described in #1426 that I didn't catch.

  • PlainYearMonth.{add,subtract} passes an options object into calendar.dateAdd(), which may modify it, and then passes the same object to calendar.yearMonthFromFields().
  • InterpretTemporalDateTimeFields (called indirectly from PlainDateTime.with(), ZonedDateTime.with(), and any entry point that takes a PlainDateTime-like or ZonedDateTime-like property bag) passes an options object into calendar.dateFromFields(), which may modify it, and then reads the overflow property from that object.

As per the reasoning in #1426, these instances should be fixed. These are normative changes.

Metadata

Metadata

Assignees

Labels

needs plenary inputNeeds to be presented to the committee and feedback incorporatedspec-textSpecification text involved

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions