Re: Determining what prototype should be used for an object

On 11/16/14, 4:13 AM, Anne van Kesteren wrote:
> I'm not exactly following how partial interfaces are problematic here.
> Once you gather them all you have a complete picture of the object,
> no?

Yes.  But a spec that defines the creation of the object may not be 
aware of all the partial interfaces and hence doesn't know to specify 
the creation of the objects returned by properties on those.

Let me give a concrete example.  Say we had, in one spec (spec A):

   interface Node {
   };
   interface Document : Node {
     Element createElement(DOMString tag);
   };
   interface Element : Node {
   };

and in another spec (spec B):

   partial interface Node {
     readonly attribute NodeList childNodes;
   }

Now createElement needs to specify that the Element is created in the 
global of the Document passed as "this".  And presumably the .childNodes 
of the Element needs to be created in the same global as the Element 
itself, since conceptually it's created when the Element is created (all 
of this is implicit right now, of course).  Which specification is 
responsible for defining that and how do we define things so as to 
minimize the chance of spec editors screwing it up?

This problem, of course, never arises in ES so far, since it's a 
monolithic spec.

-Boris

Received on Sunday, 16 November 2014 17:55:56 UTC