nzakas / understandinges6

Content for the ebook "Understanding ECMAScript 6"
5.45k stars 796 forks source link

Chapter 9: Keep constructor property non-enumerable #434

Closed OliverSieweke closed 5 years ago

OliverSieweke commented 5 years ago

Before the Square.prototype object gets replaced, its initial constructor property is non-enumerable. Keeping the constructor property non-enumerable would conform better to expected behaviour (without adding any complexity to the code).

nzakas commented 5 years ago

Nice catch! I'd prefer to leave the enumerable property defined for clarity, so I fixed it here: https://github.com/nzakas/understandinges6/commit/1a465be3c2335aac3c4dc9bbb783b95d7af6e987