Proxying built-ins (Was: [[Invoke]] and implicit method calls)

Andreas Rossberg rossberg at google.com
Wed Sep 25 11:29:47 PDT 2013


On 25 September 2013 15:49, Mark S. Miller <erights at google.com> wrote:
> Why does Date need private state? AFAICT, it only needs uniquely named
> state. Why not do what we've done for many other bits of internal state that
> doesn't need to be private: just name it with a unique symbol? This doesn't
> work for all internal state of course, but it does seem it would work for
> Date.

Because implementations need to cache various aspects of a date value
for performance. Anything but true private, on-object state would have
far too much overhead for that.

/Andreas


More information about the es-discuss mailing list