Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip write to 'name' property if not [[writable]] #2304

Merged
merged 5 commits into from Oct 28, 2020

Conversation

sjoseph7
Copy link
Contributor

@sjoseph7 sjoseph7 commented Oct 18, 2020

Purpose

Fix issue #2203 by skipping 'name' property if it is not [[writable]].

Solution

This solution works by skipping writing a source property to the target object if the property is 'name' and is not [[writable]] on the 'target'.

How to verify

  1. Check out this branch
  2. npm install
  3. npm test

Checklist for author

  • npm run lint passes

// unable to run npm script on Windows, linted manually with eslint --fix.

  • References to standard library functions are cached.

Copy link
Member

@mroderick mroderick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your pull request to fix this issue 💯

I have a couple of stylistic suggestions, trying out the multiline suggestions feature in the process.

lib/sinon/util/core/extend.js Outdated Show resolved Hide resolved
test/extend-test.js Outdated Show resolved Hide resolved
sjoseph7 and others added 2 commits October 27, 2020 15:15
Co-authored-by: Morgan Roderick <20321+mroderick@users.noreply.github.com>
Co-authored-by: Morgan Roderick <20321+mroderick@users.noreply.github.com>
Copy link
Contributor Author

@sjoseph7 sjoseph7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've committed the changes - thanks for the feedback 👍🏾

Copy link
Contributor Author

@sjoseph7 sjoseph7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~ Linted ~

@mroderick mroderick merged commit f981192 into sinonjs:master Oct 28, 2020
@mroderick
Copy link
Member

This has been published with sinon@9.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants