Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JSC] Parse a critical flag on TZ annotation for Temporal
https://bugs.webkit.org/show_bug.cgi?id=277942 Reviewed by Yusuke Suzuki. RFC 3339[1] and RFC 9557[2] allows that bracketed timezone annotations include a critical flag(!)[3]. It indicate that the parsing should be rejected if there is a conflict between the offset and the timezone annotation. Temporal API has added this feature into the spec[4]. While the critical flag does not affect the behavior of Temporal, parsing must still succeed. Currently, JSC throws an error when creating a Temporal object from a string that includes a critical flag. This patch changes to allow creating Temporal objects from strings that include a critical flag. [1]: https://www.rfc-editor.org/rfc/rfc3339 [2]: https://www.rfc-editor.org/rfc/rfc9557 [3]: https://www.rfc-editor.org/rfc/rfc9557.html#name-inconsistent-time-offset-an [4]: tc39/proposal-temporal#2397 * JSTests/stress/temporal-instant-tz-critical-flags.js: Added. * JSTests/stress/temporal-plaindate-tz-critical-flags.js: Added. * JSTests/stress/temporal-plaindatetime-tz-critical-flags.js: Added. * JSTests/stress/temporal-plaintime-tz-critical-flags.js: Added. * JSTests/test262/expectations.yaml: * Source/JavaScriptCore/runtime/ISO8601.cpp: (JSC::ISO8601::parseTimeZoneBracketedAnnotation): Canonical link: https://commits.webkit.org/282211@main
- Loading branch information