tc39 / proposal-class-public-fields

Stage 2 proposal for public class fields in ECMAScript
https://tc39.github.io/proposal-class-public-fields/
488 stars 25 forks source link

change properties to be non-configurable #6

Closed michaelficarra closed 8 years ago

michaelficarra commented 9 years ago

Hmm, this won't work right. I'll let you know when I update this PR so that multiple properties with the same name are supported.

jeffmo commented 9 years ago

It would be very unexpected for instance properties to be non-configurable by default as this is not how they work today (and often not how they are intended to work). For intentionally non-configurable properties, I think a @nonconfigurable decorator is likely the appropriate solution.

michaelficarra commented 9 years ago

I think this is fine. Like we did with classes and arrows/methods, we can make the new form more restricted because the 99.99% case wants this. Nobody uses delete. And if they do, they can add properties using assignment or explicitly set the descriptor's configurable flag or use a decorator as you suggest.

jeffmo commented 9 years ago

Ok, that's compelling. For some reason I thought there were more restrictions associated with non-configurable, but I was wrong and it seems pretty reasonable

michaelficarra commented 8 years ago

After further research, it appears that no more work is required here. ValidateAndApplyPropertyDescriptor handles the configurability for us in just the way we want.

@jeffmo Please review.

michaelficarra commented 8 years ago

@jeffmo Rebased.