Skip to content

Commit e3dfb39

Browse files
committed
fix: Do not attempt to overwrite non-writable props
1 parent 7fbe394 commit e3dfb39

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,10 @@ export function mergeWithAccessors(
412412
// if (!sourceDesc.enumerable) {
413413
// return
414414
// }
415-
if (blacklist.includes(key)) {
415+
416+
// If the destination is not writable, return. Also ignore blacklisted keys.
417+
// Must explicitly check if writable is false
418+
if (destDesc && destDesc.writable === false || blacklist.includes(key)) {
416419
return
417420
}
418421

0 commit comments

Comments
 (0)