@@ -32,6 +32,7 @@ import type {
3232const ArrayIncludes = Array . prototype . includes ;
3333const ArrayPrototypePush = Array . prototype . push ;
3434const IntlDateTimeFormat = globalThis . Intl . DateTimeFormat ;
35+ const ArraySort = Array . prototype . sort ;
3536const MathAbs = Math . abs ;
3637const MathFloor = Math . floor ;
3738const ObjectAssign = Object . assign ;
@@ -1650,7 +1651,7 @@ function adjustEras(erasParam: InputEra[]): { eras: Era[]; anchorEra: Era } {
16501651 // Ensure that the latest epoch is first in the array. This lets us try to
16511652 // match eras in index order, with the last era getting the remaining older
16521653 // years. Any reverse-signed era must be at the end.
1653- eras . sort ( ( e1 , e2 ) => {
1654+ ArraySort . call ( eras , ( e1 , e2 ) => {
16541655 if ( e1 . reverseOf ) return 1 ;
16551656 if ( e2 . reverseOf ) return - 1 ;
16561657 return e2 . isoEpoch . year - e1 . isoEpoch . year ;
@@ -2079,7 +2080,7 @@ const helperChinese: NonIsoHelperBase = ObjectAssign({}, nonIsoHelperBase, {
20792080 if (
20802081 month === undefined &&
20812082 monthCode . endsWith ( 'L' ) &&
2082- ! [ 'M01L' , 'M12L' , 'M13L' ] . includes ( monthCode ) &&
2083+ ! ArrayIncludes . call ( [ 'M01L' , 'M12L' , 'M13L' ] , monthCode ) &&
20832084 overflow === 'constrain'
20842085 ) {
20852086 let withoutML = monthCode . slice ( 1 , - 1 ) ;
@@ -2262,7 +2263,7 @@ const nonIsoGeneralImpl: NonIsoGeneralImpl = {
22622263 } ,
22632264 fields ( fieldsParam ) {
22642265 let fields = fieldsParam ;
2265- if ( fields . includes ( 'year' ) ) fields = [ ...fields , 'era' , 'eraYear' ] ;
2266+ if ( ArrayIncludes . call ( fields , 'year' ) ) fields = [ ...fields , 'era' , 'eraYear' ] ;
22662267 return fields ;
22672268 } ,
22682269 mergeFields ( fields , additionalFields ) {
0 commit comments