[EMAIL PROTECTED] is the correct mailing list for JSDT.

Figuring out the inheritance for javascript is tricky.
I think there is already a bug open for the problem you are seeing
 ( not recognizing inheritance when the prototype is a function var).
The JSDoc may not be working because it is associated with a var instead of
a function.
If you think this is a bug, you can open on against JSDT.  It is in the
WebTools product, wst.jsdt component.

Phil Berkland
IBM Software Group Emerging Technologies


                                                                       
             Klaus Reimer                                              
             <[EMAIL PROTECTED]>                                              
             Sent by:                                                   To
             [EMAIL PROTECTED]         [email protected]             
             clipse.org                                                 cc
                                                                       
                                                                   Subject
             10/17/2008 03:51          [atf-dev] Inheritance in JavaScript
             AM                        Editor                          
                                                                       
                                                                       
             Please respond to                                         
               AJAX Toolkit                                            
                 Framework                                             
                discussion                                             
             <[EMAIL PROTECTED]                                         
                   org>                                                
                                                                       
                                                                       




Hello,

first of all: I'm note sure if I'm right here. I didn't found a mailing
list for JSDT, so the closest thing I found is ATF. So if I'm wrong here
it would be nice if you could point me to the right mailing list.

My question is if there is any other inheritance syntax which is
supported by the JavaScript Editor. Looks like this one works:

function Base()
{
}

function Test()
{
}

Test.prototype=new Base();

If I write this then the JavaScript Editor detects that Test extends
Base and can give me method completion and validation and stuff like
that. The problem is that this kind of inheritance has one flaw: The
constructor of the Base class is called when the javascript file is
loaded. That's why I'm using a different type of inheritance. Basically
it works like that:

var tmpClass = function() {};
tmpClass.prototype = Base.prototype;
Test.prototype=new tmpClass();

So the trick is that I copy the prototype of the Base class into a
temporary class which has an empty constructor. This class is then
extended by the Test class. This works great but the Eclipse JavaScript
editor can not see the inheritance.

That's why I'm asking if there are other inheritance syntaxes supported
by Eclipse? I tried using an @extends JSDoc comment but this didn't
worked either.

--
Bye, K <http://www.ailis.de/~k/>
[A735 47EC D87B 1F15 C1E9 53D3 AA03 6173 A723 E391]
(Finger [EMAIL PROTECTED] to get public key)

(See attached file: signature.asc)
_______________________________________________
atf-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/atf-dev

<<inline: graycol.gif>>

<<inline: pic28317.gif>>

<<inline: ecblank.gif>>

Attachment: signature.asc
Description: Binary data

_______________________________________________
atf-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/atf-dev

Reply via email to