On 15/07/14 20:58, Boris Zbarsky wrote:
Oh, wait, this is a getter, not a method.  So this probably does mean
we're giving each Event instance a unique shape!

That's pretty sucky.  We could try to share the getter across instances
of a given Event subclass by caching the function somewhere, but it's a
bit of a PITA (e.g. we have to cache per-compartment).

It's also not clear to me per spec whether in this case there should be
separate getter functions for each instance or not; Web IDL doesn't
actually say.  This wasn't a problem as long as we only had unforgeable
things on effectively singleton objects, but with Event it becomes very
much an issue.

Arguably, there is a similarity between the duplication of properties due to "implements" statements and the duplication of properties due to their being [Unforgeable]. We have explicit wording that the Function objects corresponding to operations and the getters and setters of attributes must be distinct across "implements" targets. I don't think we have any other instances of shared Function objects. So my initial feeling is that we shouldn't use the same getter.
_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to