File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -238,10 +238,10 @@ function apply(
238
238
wrappedRetFn ?: ( result : any ) => unknown ,
239
239
) {
240
240
const arr = shallowReadArray ( self )
241
- // @ts -expect-error
242
- if ( arr [ method ] !== arrayProto [ method ] ) {
243
- // @ts -expect-error
244
- return arr [ method ] ( ... arrayProto . slice . call ( arguments , 2 ) )
241
+ let methodFn
242
+ // @ts -expect-error our code is limited to es2016 but user code is not
243
+ if ( ( methodFn = arr [ method ] ) !== arrayProto [ method ] ) {
244
+ return methodFn . apply ( arr , arrayProto . slice . call ( arguments , 2 ) )
245
245
}
246
246
247
247
let needsWrap = false
@@ -258,8 +258,7 @@ function apply(
258
258
}
259
259
}
260
260
}
261
- // @ts -expect-error our code is limited to es2016 but user code is not
262
- const result = arr [ method ] ( wrappedFn , thisArg )
261
+ const result = methodFn . call ( arr , wrappedFn , thisArg )
263
262
return needsWrap && wrappedRetFn ? wrappedRetFn ( result ) : result
264
263
}
265
264
You can’t perform that action at this time.
0 commit comments