On Saturday 2005-10-15 16:18 +0200, Krzysztof Maczynski wrote:
> >From http://www.whatwg.org/specs/web-apps/current-work/:>> "In the ECMAScript binding itself, however, the handleEvent() method
> of the interface is not directly accessible on Function objects. Such
> functions must be called in the global scope."
>> Why is that? Only to declare current browsers compliant?
I think what this (I'm assuming you're referring to
http://www.whatwg.org/specs/web-apps/current-work/#event ) is trying to
say is that this notion that a function can be used as a single-method
interface at the binding level doesn't mean that any changes in the core
ECMAScript language are required; in other words, that this part of the
specification is only defining things relating to the ECMAScript
language *binding* and not trying to change the language. I think it's
critical that specs like this not change the core language, so that
seems pretty reasonable to me.
That said, if that is what it's trying to say, it's rather poorly
worded, since it refers to the binding where I think it shouldn't.
The ability to use a function (often anonymous) instead of having to
construct an object for a single-method interface is quite useful.
I'm not sure whether there's value in having the reverse feature in the
binding, i.e., saying that objects from outside the ECMAScript world
reflected into it that implement the one-method EventListener interface
act like functions. I don't know if current browsers do this.
-David
--
L. David Baron <URL: http://dbaron.org/ >
Technical Lead, Layout & CSS, Mozilla Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20051015/4b4acc60/attachment-0001.pgp>