Skip to content

Commit a593dde

Browse files
committed
chore: fix args
1 parent daec593 commit a593dde

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Diff for: packages/reactivity/src/arrayInstrumentations.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,10 @@ function apply(
238238
wrappedRetFn?: (result: any) => unknown,
239239
) {
240240
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))
245245
}
246246

247247
let needsWrap = false
@@ -258,8 +258,7 @@ function apply(
258258
}
259259
}
260260
}
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)
263262
return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result
264263
}
265264

0 commit comments

Comments
 (0)