[nonextensible-applies-to-private] Adding private field to non-extensible object throws#4577
Conversation
ptomato
left a comment
There was a problem hiding this comment.
Looks correct so far.
For completeness, would we need to test stamping a private accessor and private method?
(I would guess that the case of stamping a private static method, or private static field cannot occur, since those go on the constructor, which cannot be frozen prior to the class declaration.)
Finally, this needs a feature flag for the proposal to be added in features.txt and in the frontmatter of the two modified tests.
For inheritance, done. For a base class, AFAICT, impossible. There are no observable states where the class, instance, or prototype are observable before methods are accessors are added.
For a private static method, AFAICT, it is indeed impossible. For a private static field, it can be done in the initializer expression. Done.
Done. (with much help from @gibson042 ) PTAL |
ptomato
left a comment
There was a problem hiding this comment.
As far as I can tell complete now, thanks!
686c790 to
f44c974
Compare
f44c974 to
1c60350
Compare
|
I left this open for a few days in case any other maintainers had any feedback, but now that it's been presented in the TC39 meeting I think it's time to merge it. I'll do that now. |
Alternative to #4563
To be the test262 tests for the https://github.com/tc39/proposal-nonextensible-applies-to-private
See tc39/proposal-nonextensible-applies-to-private#5
Initial PR content by @o-