-
-
Notifications
You must be signed in to change notification settings - Fork 769
extend is not handling property descriptors with accessors #2387
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
Labels
Comments
Good find! |
sauravazad
added a commit
to sauravazad/sinon
that referenced
this issue
Jul 17, 2021
2 tasks
There is an inherent mistake in the implementation as it does not distinguishes between Data property and Accessor property https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#properties
Attributes of a data property
Attributes of an accessor property
I have raised a PR to fix the behavior #2391. |
sauravazad
added a commit
to sauravazad/sinon
that referenced
this issue
Jul 17, 2021
sauravazad
added a commit
to sauravazad/sinon
that referenced
this issue
Jul 17, 2021
mroderick
pushed a commit
that referenced
this issue
Jul 27, 2021
This has been fixed by #2391 and published to the npm registry as |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
The 'extend' function from 'util/core' is not handling property descriptors using accessors properly.
The issue was introduced by the following commit: f981192
The below test can be used to duplicate the issue. The object 'obj' has a 'pub' property that is defined using a getter and a setter. Once 'extend' is called, the property descriptor is recreated using 'value' and ignoring the accessors.
The text was updated successfully, but these errors were encountered: