[JSC][Temporal] Implement Intl.DateTimeFormat Temporal support and toLocaleString
Temporal은 Date를 대체하기 위한 TC39 표준입니다. PlainDate, PlainTime, PlainDateTime, PlainYearMonth, PlainMonthDay, Instant 등 여섯 가지 날짜/시간 primitive를 도입합니다. Intl.DateTimeFormat은 ICU를 기반으로 동작하는 JSC의 locale 인식 formatter입니다. 두 subsystem을 연결하려면 type-aware dispatch, 처리 순서가 정해진 예외를 포함한 calendar validation, 그리고 timezone 선택 규칙이 필요합니다. plain type은 항상 GMT로 포맷하는 반면, Instant는 formatter에 설정된 timezone을 사용합니다.
이 commit에서는 HandleDateTimeValue, SameTemporalType, AdjustDateTimeStyleFormat, FormatDateTime, FormatDateTimeToParts, FormatDateTimeRange, FormatDateTimeRangeToParts가 구현되었습니다. 여섯 가지 Temporal prototype 모두에 toLocaleString도 연결되었습니다. 새로 도입된 TemporalFieldKind enum은 type별 ICU skeleton 필터링을 담당하며, 각 Intl.DateTimeFormat 인스턴스 내부에 lazy sub-formatter cache를 관리합니다. test262에서 건너뛰던 201개의 테스트가 제거되었습니다.
Significance
두 복잡한 subsystem인 Temporal과 Intl이 교차하는 대규모 코드가 추가되었습니다. 비대칭 validation 규칙(RangeError-before-TypeError 순서, PlainDate/PlainDateTime에만 적용되는 iso8601 예외), 그리고 인스턴스별 ICU formatter cache가 포함됩니다. 이 영역은 브라우저 엔진에서 역사적으로 버그가 자주 발생한 지점입니다.
Audit directions
HandleDateTimeValue의 type dispatch 경로를 점검해야 합니다. subclass된 Temporal 객체나 exotic proxy, 또는 부분적으로만 일치하는 shape이 잘못된 formatting 경로로 분기될 가능성이 있습니다. iso8601 비대칭 처리도 주목할 지점입니다. PlainDate/PlainDateTime에만 예외가 적용되고 PlainTime/PlainYearMonth/PlainMonthDay에는 적용되지 않는 구조는 잠재적인 inconsistency 버그로 이어질 가능성이 있습니다. TemporalFieldKind formatter cache는 단일 인스턴스 안에서 type별 sub-formatter를 지연 생성합니다. 하나의 formatter에서 여러 Temporal type을 번갈아 사용할 때 stale하거나 cross-contaminated된 cache entry가 생성되는지 확인해야 합니다. 또한 이 cache가 concurrent worker context에서 접근될 수 있는지도 살펴봐야 합니다. FormatDateTimeRange에서 SameTemporalType은 type check와 per-kind formatting을 분리합니다. 이 두 단계 사이에서 coercion이나 관찰 가능한 side effect가 발생하면, 타입이 일치하지 않는 객체가 그대로 통과될 가능성도 고려할 수 있습니다.