Closed michaelficarra closed 8 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.
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.
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
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.
@jeffmo Rebased.
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.