Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <2810704.ZYsuzNNPX5@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Sun, 29 Dec 2013 20:31:02 +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+&. MIME-Version: 1.0 Lines: 35 NNTP-Posting-Date: 29 Dec 2013 20:31:04 CET NNTP-Posting-Host: 859be040.newsspool1.arcor-online.net X-Trace: DXC=>TDANW?3347LNKYb?b>076ic==]BZ:af>4Fo<]lROoR1nkgeX?EC@@0:HSIQ^WeST2DZm8W4\YJN<[V>EdNCcm9M_=NE=Gbi@1 X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:22480 Cezary Tomczyk wrote: > 2013-12-28 17:20, MC wrote: > [...] >> So no one has any ideas on how to attach a function to be called when >> the Error object is called? > > Take a look at: > http://stackoverflow.com/questions/783818/how-do-i-create-a-custom-error-in-javascript The accepted answer is wrong as explained many times, not least in The correct approach is NotImplementedError.prototype = (function () { function Foo () {} Foo.prototype = Error.prototype; return new Foo; }()); or simply NotImplementedError.prototype = Object.create(Error.prototype, { … }); See also JSX:object.js. -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.