W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2011

Re: whether [Callback=FunctionOnly] should be the default

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 28 Jun 2011 23:06:51 +0000 (UTC)
To: Jonas Sicking <jonas@sicking.cc>
cc: Cameron McCormack <cam@mcc.id.au>, public-script-coord@w3.org
Message-ID: <Pine.LNX.4.64.1106282306200.20871@ps20323.dreamhostps.com>
On Tue, 28 Jun 2011, Jonas Sicking wrote:
>
> On the other hand, you can always bridge the gap between a object with 
> handleEvent and a function by changing
> 
> addEventListener("foo", someObject, false);
> to
> addEventListener("foo", someObject.handleEvent.bind(someObject), false);

That's certainly a lot less scary than messing with the prototype chain!

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 28 June 2011 23:07:13 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:03 UTC