W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2013

Re: Better event listeners

From: Jonas Sicking <jonas@sicking.cc>
Date: Thu, 17 Jan 2013 19:37:36 -0800
Message-ID: <CA+c2ei-bC_Pz5YjQVw3zvp7FDJpkRFUiZLg3jTt6P0MGYOijLA@mail.gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: Yehuda Katz <wycats@gmail.com>, DOM public list <www-dom@w3.org>
On Thu, Jan 10, 2013 at 4:47 AM, Anne van Kesteren <annevk@annevk.nl> wrote:
> On Thu, Jan 10, 2013 at 3:35 AM, Jonas Sicking <jonas@sicking.cc> wrote:
>> foo.addEventListener("click", object.clickhandler.bind(object));
>>
>> which is pretty verbose.
>
> We discussed this in depth before when discussing the approach for
> callbacks. We decided bind() was exactly the kind of feature that can
> be used for this and maybe future editions of JavaScript should make
> it easier to use, but that we would not try to work around it.

Fair enough.

/ Jonas
Received on Friday, 18 January 2013 03:38:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 18 January 2013 03:38:35 GMT