Security Demands Simplicity (was: Private Slots)
brendan at mozilla.com
Sun Jan 20 12:53:16 PST 2013
Allen Wirfs-Brock wrote:
> We we were going to talk about adding support for addition semantics to classes we should start at the level of the object model. Not with syntax. ES6 class syntax is good because it is defined in terms of the object model and more basic operations that are defined in the language. You don't have to use class syntax to define a class equivalent. So, if we are going to introduce private object state the first step is to define how it works at the object model level.
Cutting there to dodge the controversy over private-in-class based on
weak maps, to divide and conquer in the meta-discussion with David.
Here I agree with you, and we have talked in the past of the perils of
"Scenario Solving" by adding just-so syntax with novel semantics, which
is not decomposed into orthogonal primitives. You saw that in a past
life (VB5, cough) and it made messes, even though the intentions
(serving developer problem-scenarios) were good.
I think TC39 as a whole agrees.
But this doesn't settle the private-in-class-on-weak-map hash, IMHO.
More information about the es-discuss