-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JSC] Disallow sub-minute in TimeZoneAnnotation
https://bugs.webkit.org/show_bug.cgi?id=278207 Reviewed by Yusuke Suzuki. According to the latest specification of Temporal[1][2][3], sub-minute values cannot be written in the UTCOffset of a TimeZoneAnnotation within an ISO8601 string. However, in the current JSC, even if a sub-minute value is written in the TimeZoneAnnotation, no RangeError is thrown. This patch makes the following changes: - In the UTCOffset of a TimeZoneAnnotation within an ISO8601 string, sub-minute values are no longer parsed, and a RangeError will be thrown. - Update relevant function names and comments in ISO8601.cpp/ISO8601.h to follow the latest specification: * Rename `parseTimeZoneNumericUTCOffset` to `parseUTCOffset` and update comments * Rename `parseTimeZoneBracketedAnnotation` to `parseTimeZoneAnnotation` and update comments [1]: https://tc39.es/proposal-temporal/#prod-TimeZoneAnnotation [2]: https://tc39.es/proposal-temporal/#prod-TimeZoneIdentifier [3]: https://tc39.es/proposal-temporal/#prod-UTCOffset * JSTests/stress/temporal-plaindate.js: * JSTests/stress/temporal-plaindatetime.js: * JSTests/stress/temporal-plaintime.js: * JSTests/test262/expectations.yaml: * Source/JavaScriptCore/runtime/ISO8601.cpp: (JSC::ISO8601::parseTimeSpec): (JSC::ISO8601::parseUTCOffset): (JSC::ISO8601::parseTimeZoneAnnotation): (JSC::ISO8601::parseTimeZone): (JSC::ISO8601::parseTimeZoneNumericUTCOffset): Deleted. (JSC::ISO8601::parseTimeZoneBracketedAnnotation): Deleted. * Source/JavaScriptCore/runtime/ISO8601.h: * Source/JavaScriptCore/runtime/TemporalTimeZone.cpp: (JSC::TemporalTimeZone::from): * Source/JavaScriptCore/runtime/TemporalTimeZoneConstructor.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): Canonical link: https://commits.webkit.org/282710@main
- Loading branch information
1 parent
4c19011
commit 51ee7ef
Showing
8 changed files
with
45 additions
and
57 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
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