Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normative: Change internal slots of Duration to store mathematical va…
…lues This changes the internal slots of Duration to store mathematical values instead of Number values. However, only mathematical values that are (1) integers, and (2) representable by Number values, are allowed. This is achieved by storing ℝ(𝔽(_value_)) in the internal slots of Durations and in the fields of Duration Records. This should solve the problem of type confusion between Number values and mathematical values, and eliminate places where operations only defined on mathematical values (such as abs() and floor()) were applied to the Number domain. This is a normative change because it means that it is now impossible for the Number values NaN, +Infinity, -Infinity, and -0, as well as any non-integer Number values, and not-exactly-representable Number values >MAX_SAFE_INTEGER, to be exposed to JS via the property getters of Temporal.Duration. I suspect this was not possible previously with NaN and non-integer Numbers, I suspect it may have been possible with infinities and >MAX_SAFE_INTEGER, and it was definitely possible with -0. Closes: #1604 Closes: #1715
- Loading branch information