Path: csiph.com!news.mixmin.net!weretis.net!feeder4.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: custom event in IE Date: Sun, 15 Jan 2017 22:37:25 +0100 Organization: PointedEars Software (PES) Lines: 40 Message-ID: <1642042.tdWV9SEqCh@PointedEars.de> References: <8bydnVoLx8BUq-nFnZ2dnUU7-bednZ2d@westnet.com.au> <4259298.GXAFRqVoOG@PointedEars.de> <20170110215212.00003a50@gmail.com> <1747068.usQuhbGJ8B@PointedEars.de> <9a709fc2-325b-4280-98b8-1c0d5cb790cd@googlegroups.com> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1484516246 22601 eJwFwQkBwDAIA0BLA8pTOYQR/xJ65xYSkyc8jtM5mn8DXTMGu0ri69GtnBW/BqUkaJXLLakHQakSJQ== (15 Jan 2017 21:37:26 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Sun, 15 Jan 2017 21:37:26 +0000 (UTC) User-Agent: KNode/4.14.2 Cancel-Lock: sha1:B7lCkznjGETM8D1UkIEPBr+Wkzk= X-NNTP-Posting-Host: eJwFwQEBwCAMAzBLdFt7kAOM+pfwhCnofiWqaDrNGI5qqrt06Qm87FYgzsZ+XmMejHUbW/4BGxkRUQ== X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. On Saturday, January 14, 2017 at 5:03:32 PM UTC-6, Scott Sauyet wrote: >> `fn` cannot reasonably be used as a constructor function. >> So are there any clear criteria to make clear that a function *can* be >> used as a constructor? > > That's where code-conventions come into play. > > new Point(2,4) > > vs. > > new point(2,4) Yes, but: The fallacies here are to confuse native objects with host objects, and a straw man argument. So apparently my killfile is working fine. (To determine whether the second fallacy includes an affirmation of a consequent or a denial of an antecedent is left as an exercise to the reader.) You *can* tell whether *this* *object* can be called as a constructor in the way that is specified. There are two possibilities: either it throws an exception or it returns an unsuitable object. There is no evidence to suggest that any host object called as a constructor would return an unsuitable object when that kind of call would be unsupported, and obviously there is evidence that several host objects, including *this* one, behave as described (i.e. not supporting to be called as a constructor with such an argument in the MSHTML DOM). There is also a lot of evidence to suggest that a “typeof” test would be insufficient. So it is unwise to test with “typeof”, and wise to use a try-catch statement with a more detailed investigation into the thrown exception here instead. -- PointedEars FAQ: | | Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.