Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <5905423.NgFD1iC58s@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Sun, 08 Dec 2013 01:08:21 +0100 User-Agent: KNode/4.11.3 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. <1963861.2MBlU7BgDz@PointedEars.de> MIME-Version: 1.0 Lines: 49 NNTP-Posting-Date: 08 Dec 2013 01:08:30 CET NNTP-Posting-Host: 7dbd132b.newsspool4.arcor-online.net X-Trace: DXC=G74Jc6;VgYNH>ehIUb?3[ X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:22253 Thomas 'PointedEars' Lahn wrote: > […] > > The proper way is either to explicitly call the function with a reference > to the global object as the “this” value, or read “this” in global context > into a variable and use that variable (and to avoid window.onload): > > (function (global) { > global.assert = function () { … }; > }).call(this); > > or > > (function (global) { > global.assert = function () { … }; > }).call(null); JFTR: (function (global) { global.assert = function () { … }; }).call(this); or (function () { this.assert = function () { … }; }).call(null); or (function (global) { this.assert = function () { … }; }).call(void 0); > or > > (function (global) { > global.assert = function () { … }; > }(this)); > > […] -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.