Skip to content

Commit

Permalink
Merge pull request #574 from lunarraid/bugfix/563-add-writable-to-rea…
Browse files Browse the repository at this point in the history
…d-only-check

Add 'writable' descriptor check to isReadOnlyProperty
  • Loading branch information
trezy authored Feb 6, 2025
2 parents 0f8db95 + c84b9a3 commit 62993db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/isReadOnlyProperty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export function isReadOnlyProperty(
const prototype = Object.getPrototypeOf(objectInstance);
const propertyDescriptor = Object.getOwnPropertyDescriptor(prototype, propertyKey);

return !(typeof propertyDescriptor === 'undefined' || propertyDescriptor.set);
return !(typeof propertyDescriptor === 'undefined' || propertyDescriptor.writable || propertyDescriptor.set);
}

0 comments on commit 62993db

Please sign in to comment.