W3C home > Mailing lists > Public > public-webapi@w3.org > October 2007

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

From: Cameron McCormack <cam@mcc.id.au>
Date: Thu, 18 Oct 2007 18:59:18 +1000
To: Web APIs WG <public-webapi@w3.org>
Message-ID: <20071018085918.GC8388@arc.mcc.id.au>

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() { … };

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() { … } };

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

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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:16:24 UTC