-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normative: Throw on duplicates in PrepareTemporalFields
It should be an error to return duplicate fields in a Calendar's field() method, thus we throw if we encounter one in PrepareTemporalFields. There are two cases (PlainMonthDay.prototype.toPlainDate and PlainYearMonth.prototype.toPlainDate) where, after checking on the return values of field() in previous invocations of PrepareTemporalFields, we want to deduplicate the field name list in a later call to PrepareTemporalFields after concatenating them, since we sort them in PrepareTemporalFields. For this reason, we add a duplicateBehavior parameter to PrepareTemporalFields. This allows us to remove the MergeLists abstract operation, now replaced by a simple list concatenation and deduplication in PrepareTemporalFields with duplicateBehavior set to ignore. It should also be an error to return field names 'constructor' or '__proto__' in a Calendar's field() method, and we throw if that happens. Fixes #2532, 2576.
- Loading branch information
Showing
7 changed files
with
62 additions
and
96 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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