ljharb / es-abstract

ECMAScript spec abstract operations.
MIT License
114 stars 30 forks source link

[Fix] `Set`: Avoid observable `[[Get]]` where possible #101

Closed ExE-Boss closed 4 years ago

ExE-Boss commented 4 years ago

https://github.com/ljharb/es-abstract/commit/7a963e3939da431e994d2181875f95b1e8ab239e made it so that Set invokes the [[Get]] internal method when Throw is set, regardless of whether the environment is IE 9.

This makes it so that the observable [[Get]] call isn’t performed in environments that correctly throw when attempting to set read‑only properties.

This also fixes the bug where Set would return undefined for successful sets when Throw === false.