Skip to content

Commit 6e59098

Browse files
HcySunYangyyx990803
authored andcommitted
refactor: set should return early if original def has getter but no setter (#7981)
1 parent c356b29 commit 6e59098

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: src/core/observer/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ export function defineReactive (
179179
if (process.env.NODE_ENV !== 'production' && customSetter) {
180180
customSetter()
181181
}
182+
// #7981: for accessor properties without setter
183+
if (getter && !setter) return
182184
if (setter) {
183185
setter.call(obj, newVal)
184186
} else {

0 commit comments

Comments
 (0)