Are internal data properties ever inherited?
brendan at mozilla.com
Tue Oct 8 10:38:07 PDT 2013
Claude Pache wrote:
> It may be useful to recall that there are different concepts in the
> spec that have a name enclosed in double square brackets. I have found
> these three:
> * attributes of object properties (Section 188.8.131.52) ;
Note this is an ES5 change from ES1-3, which used DontDelete, DontEnum,
and ReadOnly without [] brackets.
> * internal methods and internal data properties of objects (Section
> 184.108.40.206) ;
> * fields of records (Section 6.2.2) .
> Among those concepts, the notation `O.[[X]]` is defined (and, I
> presume, used) only for fields of records. But there is some risk for
> the reader to accidentally extend this notation to internal data
> properties of objects.
I agree on risk of confusion. Distinct notation for notably distinct
spec constructs seems best. Just []-bracketing all spec-level or
unreflected meta-level names does not achieve any particular goal, and
we don't do that anyway.
In contrast to programming languages hindered by QWERTY and ASCII
legacies, the Spec has lots of typographic expressiveness to choose
from. True, ASCII transcriptions and mockups would be harder, but some
alternative brackets (chevrons) have digraphs (<< and >>). And perhaps
just a few nice font choices and no brackets (which add non-trivial
visual noise) would be better for some use-cases.
Allen, what do you think?
More information about the es-discuss