This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
>"Set PROTOTYPE as the prototype property on CONSTRUCTOR >Set CONSTRUCTOR as the constructor property on PROTOTYPE." Those should be defining properties, not setting them. Furthermore, those properties should have some non-default property attributes (which you have to think about once you start defining properties). In particular, the .constructor of the prototype should not be enumerable (because otherwise enumeration on all the elements involved would see it!), and the .prototype of the constructor should probably not be configurable, writable, or enumerable (which is how WebIDL .prototype and standard class .prototype work), though this part we could at least argue about.
Since this is a function object, it will already have the "prototype" property per http://ecma-international.org/ecma-262/5.1/#sec-13.2 But you're right, I need to define the "constructor" property.
> Since this is a function object, it will already have the "prototype" property The spec section you link to is what happens if you create a function from a string. It's not applicable here, unless you explicitly invoke it in the components spec (in which case you have to define the inputs to that algorithm and whatnot.. but I suspect you do not in fact want to go there, since you want these to be [native code] functions). You should really look into how WebIDL defines its constructor objects and ideally share that definition....
(In reply to comment #2) > > Since this is a function object, it will already have the "prototype" property > > The spec section you link to is what happens if you create a function from a > string. It's not applicable here, unless you explicitly invoke it in the > components spec (in which case you have to define the inputs to that > algorithm and whatnot.. but I suspect you do not in fact want to go there, > since you want these to be [native code] functions). > > You should really look into how WebIDL defines its constructor objects and > ideally share that definition.... (In reply to comment #2) > > Since this is a function object, it will already have the "prototype" property > > The spec section you link to is what happens if you create a function from a > string. It's not applicable here, unless you explicitly invoke it in the > components spec (in which case you have to define the inputs to that > algorithm and whatnot.. but I suspect you do not in fact want to go there, > since you want these to be [native code] functions). There's a not at the end that simply states: "A prototype property is automatically created for every function, to allow for the possibility that the function will be used as a constructor." Or is this not enough? > > You should really look into how WebIDL defines its constructor objects and > ideally share that definition.... Yup. And probably file bugs against WebIDL.
A note at the end of the algorithm that's not being used here? Seriously, this just needs to be defined. It doesn't come for free with the current state of ES.
(In reply to comment #4) > A note at the end of the algorithm that's not being used here? > > Seriously, this just needs to be defined. It doesn't come for free with the > current state of ES. Sounds good, filing bug against WebIDL here: http://www.w3.org/TR/WebIDL/#dfn-function-object
I ended up letting WebIDL do the work: "Let CONSTRUCTOR be the interface object whose interface prototype object is PROTOTYPE ...", which is defined pretty well in WebIDL.