-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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 Spread should not invoke setter. #13668
Comments
Is this a curious issue of spec compliance, or a real-world thing? |
Purely compliance issue, I haven't seen any real world problem. Not even in Babel's issue list. |
It's not just a question of spec compliance. First of all, Babel implements this behavior so people migrating from Babel to TypeScript may introduce bugs into their codebases. Secondly, this is important for some security-enhanced environments as it's possible to monkey-patch methods like |
@RyanCavanaugh based on some of your more recent comments I think you are not actively interested in issues like this. Perhaps this one can be closed? |
Current stage-3 spec requires object spread should define new properties on rest object, not set value on rest object.
Spec:
http://sebmarkbage.github.io/ecmascript-rest-spread/#AbstractOperations-CopyDataProperties
More readable example:
https://github.com/sebmarkbage/ecmascript-rest-spread/blob/master/Issues.md#setters
TypeScript Version: nightly
Code
Expected behavior:
No runtime error.
Actual behavior:
Runtime error.
Note: Babel does not define properties by default either.
The text was updated successfully, but these errors were encountered: