Path: csiph.com!aioe.org!news.mb-net.net!open-news-network.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Overriding function and adding a bit Date: Fri, 12 May 2017 01:53:30 +0200 Organization: PointedEars Software (PES) Lines: 68 Message-ID: <10849548.O9o76ZdvQC@PointedEars.de> References: <5178377.MhkbZ0Pkbq@PointedEars.de> <20479369.6Emhk5qWAg@PointedEars.de> Reply-To: Thomas 'PointedEars' Lahn NNTP-Posting-Host: 170.224.197.178.dynamic.wless.zhbmb00p-cgnat.res.cust.swisscom.ch Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: gwaiyur.mb-net.net 1494546811 4436 178.197.224.170 (11 May 2017 23:53:31 GMT) X-Complaints-To: abuse@open-news-network.org NNTP-Posting-Date: Thu, 11 May 2017 23:53:31 +0000 (UTC) User-Agent: KNode/4.14.2 X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. For your reference, records indicate that > Thomas 'PointedEars' Lahn wrote: It is called attribution _line_, not attribution novel. >> Are the subscribers of this newsgroup supposed to believe that “Doc >> O’Leary” is your real name? > > I don’t have a “real” name. Thanks for the clarification. Score adjusted. > They’ve all been made up, including the one that was put on my birth > certificate. The name on whatever current official document of identity you have is your real name. Look it up. (But, of course, you already know that.) > I’ve been using Doc O’Leary on Usenet since at least 1990: Your problem. > […] > How about yourself, Pointy? Though I really don’t see how any of this > matters to the topic at hand. Focus. As you can read everywhere, my real name is Thomas Lahn. As customary in Usenet, I have inserted my nickname between my first name and last name in the “From” header field value – the former is “PointedEars”, _not_ “Pointy”. But, of course, as you have been using Usenet “since at least 1990”, you know all of that. You are just trolling – typical for a pseudonymous wannabe. >> “this” is not necessarily referring to the same object that the function >> is called as a method of. > > Well, it has to be referring to *something* for the code to work as > expected. I see no reason *not* to call it as a method on the target > object (or prototype thereof), thus allowing the OP to override the > special case of the “foo” object that needs to behave differently. My point is that “this” can be anything (except an execution context, contrary to what you thought), and the comparison would work with anything except a value for “this” that cannot be converted to an object. >> The original code of the function is: >> >> function ObjLayerMoveTo(x, y) { >> /* 100+ lines of spaghetti code */ >> } > > Which says nothing about how it is called, or the larger context in > which it was defined. Exactly. So it is a jump to conclusions on your part that it would be inappropriate to simply redefine the function as the OP suggested. You have not even come up with a convincing argument for a case where this would not work as intended (you left that part to me). EOD -- PointedEars FAQ: | | Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.