From: David Mark on
Dmitry A. Soshnikov wrote:
> On Jan 13, 4:50 pm, Thomas 'PointedEars' Lahn <PointedE...(a)web.de>
> wrote:
>
> [...]
>
>>> foo: function () {
>>> this._super(); // will call `foo' in parent
>>> }
>> Never. Check your assumptions.
>>
>
> So? I was asking to remember this words. And showed you that it's
> possible (regardless the code itself). Is it really never? I'm waiting
> your agreement that it's possible. Your helper David is also welcome
> for that.
>

Speaking of help, you don't help yourself at all, do you?
From: Dmitry A. Soshnikov on
On Jan 13, 4:50 pm, Thomas 'PointedEars' Lahn <PointedE...(a)web.de>
wrote:

[...]

> You clearly don't know what you are talking about.  Now what does `this'
> refer to in a prototype method when called by an instance?
>

Yeah, about this - also. I'm waiting.

For the future, please don't use demagogy in statement form such as
"you don't know what you are talking about", ok? Thanks.

/ds
From: Garrett Smith on
David Mark wrote:
> wmc wrote:
>> David Mark wrote:
>>
[...]

>
> Droll. Just watch out for some of his wackier ideas (hard to spot for
> beginners, which is why the Good Parts is not recommended in the FAQ).
http://jibbering.com/faq/#books

It's there, with diplomatic words I wrote:-

| The following books have been considered to have value by some
| individuals on c.l.js. The reviews of these books are provided:

After I reviewed the Good Parts, I concluded that it had too many
serious, obvious, and beginner mistakes to be worth recommending.

Then Jorge came and brought an assault of fake, lengthy "FAQ Topic"
posts of Crockford and his videos. There were others who supported the
inclusion of Crockford's book. Peter Michaux argued for its inclusion.
Finally John Harris wrote a good review of it and we included that,
along with some NG postings.

I haven't read Zakas' book. Juriy reviewed it.

http://perfectionkills.com/professional-javascript-review/
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/
From: David Mark on
Garrett Smith wrote:
> David Mark wrote:
>> wmc wrote:
>>> David Mark wrote:
>>>
> [...]
>
>>
>> Droll. Just watch out for some of his wackier ideas (hard to spot for
>> beginners, which is why the Good Parts is not recommended in the FAQ).
> http://jibbering.com/faq/#books
>
> It's there, with diplomatic words I wrote:-
>
> | The following books have been considered to have value by some
> | individuals on c.l.js. The reviews of these books are provided:
>
> After I reviewed the Good Parts, I concluded that it had too many
> serious, obvious, and beginner mistakes to be worth recommending.

Right.

>
> Then Jorge came and brought an assault of fake, lengthy "FAQ Topic"
> posts of Crockford and his videos.

Yes. I remember that, but they were/are meaningless.

> There were others who supported the
> inclusion of Crockford's book. Peter Michaux argued for its inclusion.
> Finally John Harris wrote a good review of it and we included that,
> along with some NG postings.

John Harris wrote a _good_ review of it, or a review that said it was
good? I suspect the former.

>
> I haven't read Zakas' book. Juriy reviewed it.
>
> http://perfectionkills.com/professional-javascript-review/

He's nice about it, but clearly it is another pathetic compendium of
misinformation about browser scripting. Having recently read his
article on browser sniffing (which is used in the book apparently), I
wouldn't bother reading a whole book's worth. ;)
From: Thomas 'PointedEars' Lahn on
Dmitry A. Soshnikov wrote:

> Thomas 'PointedEars' Lahn wrote:
>> Dmitry A. Soshnikov wrote:
>> > [...]
>> > if (method == '__extends') {
>> > continue;
>> > }
>> > Klass.prototype[method] = params[method];
>> > if (params.__extends && typeof params.__extends.prototype[method]
>> > == 'function') {
>> > (function (methodName) {
>> > var __originalMethod = params[methodName];
>> > var __superMethod = params.__extends.prototype[methodName];
>> > Klass.prototype[methodName] = function () {
>> > var __previousSuper = this._super;
>> > this._super = __superMethod;
>> > var result = __originalMethod.apply(this, arguments);
>> > this._super = __previousSuper;
>> > return result;
>> > };
>> > })(method);
>>
>> You can't be serious. Efficiency aside, this is not thread-safe, not
>> even exception-safe. So even if we would be operating in an ECMAScript
>> vacuum without DOMs this would not be acceptable.
>>
>> > }
>> > }
>>
>> > return Klass;
>>
>> > }
>>
>> > Class.emptyFn = function () {};
>>
>> > ---------------------------------
>>
>> > So, nothing special, all of this you all know.
>>
>> Unfortunately.
>>
>> > [...]
>> > But as I said, I don't like this implementation much as it's not so
>> > useful from the performance.
>>
>> Performance is the least of its issues. This is even worse than what
>> Jorge proposed.
>>
>> > [caller nonsense]
>>
>> Please refrain from posting it, then. Nothing useful/sane can be
>> learned there.
>
> Ah, common ;)

What?

> I was asking do not discuss the code itself but to concentrate on the
> main thing we were talking about - is possible to use `this._super()'
> with correct meaning (and behavior) or not? That's all.

Yes, it is possible, but not even remotely safe (I would never have gotten
the lunatic idea of backing up and restoring the method value, just as I
never have gotten Jorge's rather lunatic idea of deleting a property and
restoring it, which is much the same nonsense; only you put it over the top
with the Klass and the closure part aso.). In fact, it is incredibly naive
and ultimately stupid to do it like that, for the reasons mentioned above
(not only for the lack of efficiency). Had you managed to quote properly,
you might have known.

So congratulations, you've "won". (Satisfied now?)

> About implementation with caller, I guess you've understand the main
> principle and can do it yourself if will be needed.

Fortunately, no such junk will be needed in my code. Ever.


PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann