@@ -32,6 +32,7 @@ import type {
32
32
const ArrayIncludes = Array . prototype . includes ;
33
33
const ArrayPrototypePush = Array . prototype . push ;
34
34
const IntlDateTimeFormat = globalThis . Intl . DateTimeFormat ;
35
+ const ArraySort = Array . prototype . sort ;
35
36
const MathAbs = Math . abs ;
36
37
const MathFloor = Math . floor ;
37
38
const ObjectAssign = Object . assign ;
@@ -1650,7 +1651,7 @@ function adjustEras(erasParam: InputEra[]): { eras: Era[]; anchorEra: Era } {
1650
1651
// Ensure that the latest epoch is first in the array. This lets us try to
1651
1652
// match eras in index order, with the last era getting the remaining older
1652
1653
// years. Any reverse-signed era must be at the end.
1653
- eras . sort ( ( e1 , e2 ) => {
1654
+ ArraySort . call ( eras , ( e1 , e2 ) => {
1654
1655
if ( e1 . reverseOf ) return 1 ;
1655
1656
if ( e2 . reverseOf ) return - 1 ;
1656
1657
return e2 . isoEpoch . year - e1 . isoEpoch . year ;
@@ -2079,7 +2080,7 @@ const helperChinese: NonIsoHelperBase = ObjectAssign({}, nonIsoHelperBase, {
2079
2080
if (
2080
2081
month === undefined &&
2081
2082
monthCode . endsWith ( 'L' ) &&
2082
- ! [ 'M01L' , 'M12L' , 'M13L' ] . includes ( monthCode ) &&
2083
+ ! ArrayIncludes . call ( [ 'M01L' , 'M12L' , 'M13L' ] , monthCode ) &&
2083
2084
overflow === 'constrain'
2084
2085
) {
2085
2086
let withoutML = monthCode . slice ( 1 , - 1 ) ;
@@ -2262,7 +2263,7 @@ const nonIsoGeneralImpl: NonIsoGeneralImpl = {
2262
2263
} ,
2263
2264
fields ( fieldsParam ) {
2264
2265
let fields = fieldsParam ;
2265
- if ( fields . includes ( 'year' ) ) fields = [ ...fields , 'era' , 'eraYear' ] ;
2266
+ if ( ArrayIncludes . call ( fields , 'year' ) ) fields = [ ...fields , 'era' , 'eraYear' ] ;
2266
2267
return fields ;
2267
2268
} ,
2268
2269
mergeFields ( fields , additionalFields ) {
0 commit comments