@@ -9,15 +9,23 @@ features: [Temporal]
99
1010[ "m1" , "M1" , "m01" ] . forEach ( ( monthCode ) => {
1111 assert . throws ( RangeError , ( ) => Temporal . PlainMonthDay . from ( { monthCode, day : 17 } ) ,
12- `monthCode '${ monthCode } ' is not well-formed` ) ;
12+ `monthCode '${ monthCode } ' is not well-formed (without numeric month)` ) ;
13+ assert . throws ( RangeError , ( ) => Temporal . PlainMonthDay . from ( { month : 1 , monthCode, day : 17 } ) ,
14+ `monthCode '${ monthCode } ' is not well-formed (with numeric month)` ) ;
1315} ) ;
1416
1517assert . throws ( RangeError , ( ) => Temporal . PlainMonthDay . from ( { year : 2021 , month : 12 , monthCode : "M11" , day : 17 } ) ,
1618 "monthCode and month conflict" ) ;
1719
1820[ "M00" , "M19" , "M99" , "M13" , "M00L" , "M05L" , "M13L" ] . forEach ( ( monthCode ) => {
1921 assert . throws ( RangeError , ( ) => Temporal . PlainMonthDay . from ( { monthCode, day : 17 } ) ,
20- `monthCode '${ monthCode } ' is not valid for ISO 8601 calendar` ) ;
22+ `monthCode '${ monthCode } ' is not valid for ISO 8601 calendar (without numeric month)` ) ;
23+ var plausibleMonth = Number ( monthCode . slice ( 1 , 3 ) ) + ( monthCode . length - 3 ) ;
24+ assert . throws (
25+ RangeError ,
26+ ( ) => Temporal . PlainMonthDay . from ( { month : plausibleMonth , monthCode, day : 17 } ) ,
27+ `monthCode '${ monthCode } ' is not valid for ISO 8601 calendar (with numeric month)`
28+ ) ;
2129} ) ;
2230
2331assert . throws (
0 commit comments