Skip to content

Commit

Permalink
fix(merge): don't serialize getters when merging
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignigena committed Aug 19, 2023
1 parent 06afe59 commit 2e55932
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/config/merge.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const merge = (...sources) => sources.reduce((result, toMerge) => {
} else if (isObject(oldValue) && isObject(newValue)) {
result[key] = merge(oldValue, newValue)
} else {
result[key] = newValue
Object.defineProperty(result, key, Object.getOwnPropertyDescriptor(toMerge, key))
}
}

Expand Down
4 changes: 2 additions & 2 deletions core/config/merge.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ describe('merge', () => {
get foo () {
return 'bar'
},
bar: 'bat'
bat: 'baz'
}, {
get bar () {
return 'baz'
return this.bat
}
})

Expand Down

0 comments on commit 2e55932

Please sign in to comment.