Re: [Bindings] extended attribute for callback function interfaces?

Jonas Sicking:
> It doesn't make much sense for interfaces that aren't callback 
> interfaces.

It seems to me to make as much sense as being able to implement such
non-callback interfaces with an object with properties.

> Also, interfaces that are expected to get more functions 
> added in later versions would seem bad to make implementable as a 
> function as the behavior would get very confusing when the later version 
> of the spec is implemented.

I don’t think it would be confusing.  If you had

  interface A {
    void f1(in Callback c);
  };

  interface Callback {
    void f2();
  };

and in script:

  var a = …; // some object that implements A
  var c = function() { … };
  a.f1(c);

If Callback got another method later on, you’d get a TypeError saying
that ‘c’ didn’t implement Callback.  So you’d need to change it to an
object with two properties.

But even if you were using the other way of implementing Callback:

  var a = …; // some object that implements A
  var c = { f1: function() { … } };
  a.f1(c);

then if Callback got another method later on you’d still have the same
problem; ‘c’ doesn’t implement Callback.  So you still need to make a
change.

-- 
Cameron McCormack, http://mcc.id.au/
 xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

Received on Thursday, 18 October 2007 08:59:37 UTC