Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [atf-dev] Inheritance in JavaScript Editor

wtp-dev@xxxxxxxxxxx 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
Inactive hide details for Klaus Reimer <k@xxxxxxxx>Klaus Reimer <k@xxxxxxxx>


          Klaus Reimer <k@xxxxxxxx>
          Sent by: atf-dev-bounces@xxxxxxxxxxx

          10/17/2008 03:51 AM

          Please respond to
          AJAX Toolkit Framework discussion <atf-dev@xxxxxxxxxxx>

To

atf-dev@xxxxxxxxxxx

cc


Subject

[atf-dev] Inheritance in _javascript_ Editor

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 k@xxxxxxxx to get public key)

(See attached file: signature.asc)_______________________________________________
atf-dev mailing list
atf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/atf-dev

GIF image

GIF image

GIF image

Attachment: signature.asc
Description: Binary data


Back to the top