[Bug 27017] [Custom]: Constructor/prototype linkage needs to actually be defined, since it's dynamic, not static

https://www.w3.org/Bugs/Public/show_bug.cgi?id=27017

--- Comment #1 from Dimitri Glazkov <dglazkov@chromium.org> ---
(In reply to Boris Zbarsky from comment #0)
> See https://bugzilla.mozilla.org/show_bug.cgi?id=1081037#c1 for an
> explanation of the issues.

> Specifically, all it says is:

>   Let CONSTRUCTOR be the interface object whose interface prototype object is PROTOTYPE

> What this would normally mean in Web IDL is the following:

  CONSTRUCTOR.prototype == PROTOTYPE
  PROTOTYPE.constructor == CONSTRUCTOR

> but these are static constraints in Web IDL, since the set of interfaces is fixed.

Yep, that's exactly what it means. I could specify this in ES terms, rather
than Web IDL, would that help?

http://es5.github.io/#x13.2

> For the registerElement case, what happens if the same prototype is registered multiple times?  What does its .constructor end up being?  Futhermore, what should happen if the .constructor is non-configurable, or nonwritable, or both, before the registerElement call happens?  Is the property set via Put() or via  DefinePropertyOrThrow() or something else?

This is already spec'd here:
http://w3c.github.io/webcomponents/spec/custom/#dfn-custom-element-constructor-generation

> I mean, in terms of implementation we can just JS_LinkConstructorAndPrototype and move on for now, but that may not give us the same behavior that Chrome has, and per spec the behavior is just not defined

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 10 October 2014 16:22:41 UTC