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

Object.defineProperties and Object.defineProperty overwrite existing values #1418

Closed
raskad opened this issue Jul 21, 2021 · 0 comments · Fixed by #1419
Closed

Object.defineProperties and Object.defineProperty overwrite existing values #1418

raskad opened this issue Jul 21, 2021 · 0 comments · Fixed by #1419
Labels
bug Something isn't working
Milestone

Comments

@raskad
Copy link
Member

raskad commented Jul 21, 2021

Describe the bug
Object.defineProperties and Object.defineProperty overwrite existing values when they only should set attributes.

To Reproduce
This JavaScript code reproduces the issue:

var arr = [];
Object.defineProperties(arr, {
  length: {
    writable: false
  }
});
arr.length

Expected behavior
In the example arr.length is overwritten with undefined, but the Object.defineProperties call should only affect the writable attribute while leaving the value of the property unchanged.

Build environment:

  • OS: [Linux]
  • Version: [master]
  • Target triple: [x86_64-unknown-linux-gnu]
  • Rustc version: [rustc 1.52.0 (88f19c6da 2021-05-03)]
@raskad raskad added the bug Something isn't working label Jul 21, 2021
@Razican Razican added this to the v0.13.0 milestone Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants