Skip to content

Commit a07f1b2

Browse files
committed
refactor(reactivity): unnecessarily func call
1 parent 0ac0f2e commit a07f1b2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/reactivity/src/baseHandlers.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
type Target,
3+
isProxy,
34
isReadonly,
45
isShallow,
56
reactive,
@@ -57,7 +58,7 @@ function createArrayInstrumentations() {
5758
}
5859
// we run the method using the original args first (which may be reactive)
5960
const res = arr[key](...args)
60-
if (res === -1 || res === false) {
61+
if (isProxy(args[0]) && (res === -1 || res === false)) {
6162
// if that didn't work, run it again using raw values.
6263
return arr[key](...args.map(toRaw))
6364
} else {

0 commit comments

Comments
 (0)