Any reason why __proto__ is not a well known symbol?
Tab Atkins Jr.
jackalmage at gmail.com
Tue Feb 16 04:51:22 UTC 2016
On Mon, Feb 15, 2016 at 8:34 PM, JD Isaacks <jd at jisaacks.com> wrote:
> I know ES2015 formally made the `__proto__` property a way to access/set an
> object's internal `[[Prototype]]` property.
> Is there any reason why this wasn't spec'd as a well known symbol such as
> `@@__proto__`. It just seems like it would line up well with other modifiers
> like `@@iterator`, `@@species`, etc.
It was specified before symbols existed, and all implementations do it
as a string property. If we were reinventing it today it would either
be a symbol or something in the MOP, but are hands are tied by legacy.
> Being that it was not formally spec'd it shouldn't have broke backwards
> compatibility either.
Backwards compat has nothing to do with specs, and everything to do
with existing implementations. Multiple implementations agreed on
__proto__, so our choice was either to leave it unstandardized or spec
what the browsers did.
More information about the es-discuss