Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: What's wrong with this code? Date: Thu, 26 Feb 2015 17:09:07 +0100 Organization: PointedEars Software (PES) Lines: 26 Message-ID: <2865092.U4gHO1vGHG@PointedEars.de> References: <8761aopx65.fsf@bsb.me.uk> <2083952.afr504CXY5@PointedEars.de> <87mw40n0or.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 1424967027 15477 eJwFwQkBwDAIA0BLfKFUTgnDv4TdwVOTJxIZWKypSNaQ2lenxtG0+1ooYMiT9DPOjyiuzf4YmxF2 (26 Feb 2015 16:10:27 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Thu, 26 Feb 2015 16:10:27 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwNzMkRwDAIBLCWuIPLgTX0X0I8+ss1OPBZeJjvc/NoVkwDItKqHkU1Tnwii5tgbbniDPTQ+HIlgcH3vOIHUdoVdw== Cancel-Lock: sha1:LS1r8PmBIKiygo/zhayd1OYE56o= X-NNTP-Posting-Host: eJwFwQkBwDAMAkBNKYFSO8vjX8LuCIXqpqjkciFZGQ65pVhs6KvLeQtw2vSbch/U6an+AQE0EPQ= Xref: csiph.com comp.lang.javascript:26940 Ben Bacarisse wrote: > Thomas 'PointedEars' Lahn writes: >> Ben Bacarisse wrote: >>> You might (in some very odd implementation) get 'null' from typeof, but >>> that's only because the result is up to the implementation in some very >>> specific cases. >> To be exact, a conforming implementation of ECMAScript could only provide >> "null" as the result of a “typeof” operation if the operand was a >> reference to a host object. > > To be more exact, only if the reference is to a host object that does > not implement [[Call]]. For references to callable object, both native > and host, the result must be 'function'. True. So much for theory. In practice, the result is "object" for callable host objects in the MSHTML DOM until MSHTML 8.0.x inclusive. -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.