- From: David Bruant <bruant.d@gmail.com>
- Date: Tue, 24 Sep 2013 09:31:50 +0200
- To: Boris Zbarsky <bzbarsky@MIT.EDU>
- CC: "public-script-coord@w3.org" <public-script-coord@w3.org>
Le 24/09/2013 02:07, Boris Zbarsky a écrit : > On 9/23/13 5:43 PM, David Bruant wrote: >> Maybe IE9 has a form of self-hosted addEventListener, somthing like: >> EventTarget.prototype.addEventListener = function(type, listener){ >> // use |this| as an object >> } >> >> IE9 has no support for strict mode, so the code would be non-strict and >> "this" has the global object as value by default when the function is >> called as a function (as opposed to as a method). > > It has the global object as default value no matter how it's called, > in non-strict code. Simple testcase: > > <script> > (function f() {alert(this);}).call(undefined); > </script> > > try it in your favorite browser. Yep, I was mistaken. My bad. David
Received on Tuesday, 24 September 2013 07:32:23 UTC