Re: [whatwg] WebIDL and HTML5

Garrett Smith:
> Granting programs access to native interfaces makes the program less
> stable. It also changes the meaning of the word interface to mean
> something that I don't know what it is. For example, an Interface
> cannot have a constructor, yet in WebIDL[4]:-
> 
> | An ECMAScript implementation supporting these interfaces
> | would have a [[Construct]] property on the Circle interface
> | object which would return a new object that implements the
> | interface.
> 
> - defines a type of interface that implements [[Construct]].
> 
> Interfaces are used to describe objects. They should be flexible. They
> should not provide any implementation. An object can be defined to
> implement many interfaces and should not have any one of those
> interfaces be a "constructor".

The term I’ve used is “interface object”, not “interface”.  It’s an
object that provides access to functionality related to that IDL
interface.  You can think of an interface object with [[Construct]] as
being also a factory object for that interface, that happens to allow
the use of 'new' in ES to invoke the factory method.

-- 
Cameron McCormack ≝ http://mcc.id.au/

Received on Wednesday, 27 August 2008 07:35:41 UTC