Skip to content

Commit bf4bdaa

Browse files
committed
refactor(reactivity): remove redundant variable declaration
1 parent 82da43d commit bf4bdaa

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/reactivity/src/baseHandlers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,12 @@ class MutableReactiveHandler extends BaseReactiveHandler {
146146
): boolean {
147147
let oldValue = target[key]
148148
if (!this._isShallow) {
149-
const isOldValueReadonly = isReadonly(oldValue)
150149
if (!isShallow(value) && !isReadonly(value)) {
151150
oldValue = toRaw(oldValue)
152151
value = toRaw(value)
153152
}
154153
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
155-
if (isOldValueReadonly) {
154+
if (isReadonly(oldValue)) {
156155
return false
157156
} else {
158157
oldValue.value = value

0 commit comments

Comments
 (0)