Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Expression for the global object Date: Sun, 31 May 2015 16:21:46 +0200 Organization: PointedEars Software (PES) Lines: 24 Message-ID: <2563043.EPzh7ypYKR@PointedEars.de> References: <87twuthx5h.fsf@bsb.me.uk> <5452925.Zt9fTqAOub@PointedEars.de> <87382cj1f5.fsf@bsb.me.uk> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1433082262 25647 eJwFwYERADAEBLCVaP2XcXDsP0ITXCr7GUHDYjnjFdUxd3IGp6lwT7cjFmSqwylvk7dQ8gEnYRDj (31 May 2015 14:24:22 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Sun, 31 May 2015 14:24:22 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwNw4ERACEIA7CVVGzlx4EK+4/g5y4wTupsghuNtm54jawvatdlp3LqKnz5SZQpOVF/D1vuGh0yLeShhd8HjnQWsw== Cancel-Lock: sha1:9M/bHP+k9vA/1cQv0PEy38qrbZk= X-NNTP-Posting-Host: eJwFwQEBACAIA7BKXPjFOIrSP4IbXVDNEBVs9tq5hF1GizF4EW8ei44nlnUxlQ7Iz0X5rg8HrRCS Xref: csiph.com comp.lang.javascript:27944 Ben Bacarisse wrote: > Thomas 'PointedEars' Lahn writes: >> Ben Bacarisse wrote: >>>> Function("return this")() >>> […] >> >> […] if “Function” refers to the Function constructor, that expression – >> regardless whether the constructor is called as a function, without “new” >> – returns a reference to the global object, regardless whether the >> calling execution context is in strict mode. (I stand corrected.) > > Oh, did you say otherwise? I suggested using Function when you pointed > out the flaw in using thunk that returns this (my first suggestion), but > you didn't reply to that post (as far as I can recall). My followup that I thought I had posted yesterday was still in Drafts, which I have updated and posted now. -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.