-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V8 prefers to normatively change non-extensible to imply fixed (no private stamping) #5
Comments
Doesn't "no private stamping" also apply to Like one of the motivations for the proxy trap is that it can simulate the builtin behaviour:
Without the trap |
Right, this is a consequence of this preference, that |
Does this mean adding a private element to a proxy would now invoke the |
Yes. But without the consolidation, i.e., in the proposal as currently written, adding a private element to a proxy would invoke the is-non-trapping trap. So either way, this would need to trap. |
V8 team's preference is to remove the need for an additional bit for the "no private stamping" behavior, and instead to change non-extensible to imply it. We think this is most natural and aligns best with programmer intuition.
The big question is whether this change is backwards compatible. To that end we've added the use counter
V8ExtendingNonExtensibleWithPrivate
to see if anyone is actually adding private fields to non-extensible objects today. This is scheduled to hit Chrome stable builds by the end of January, so we won't see truly representative numbers until next year.In the December 2024 TC39, other delegates and champions were positive on the idea of this change if it's compatible to make.
The text was updated successfully, but these errors were encountered: