Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to get parameter types of a javascript function compiled using rhino

383 views
Skip to first unread message

vivek...@gmail.com

unread,
Feb 10, 2009, 1:51:50 AM2/10/09
to
how to get parameter types of a javascript function compiled using
rhino?????

FoxZ

unread,
Feb 12, 2009, 4:59:46 AM2/12/09
to
On 10 fév, 07:51, vivekoc...@gmail.com wrote:
> how to get parameter types of a javascript function compiled using
> rhino?????

typeof(x)

sorry

Patrick Dobbs

unread,
Feb 12, 2009, 5:10:40 AM2/12/09
to
typeof(x) works from javascript, but if type info is needed then the
sender of this thread post is presumably trying to call a function
defined inside a js script from Java.

Since javascript is untyped, I presume that if you don't know beforehand
what type parameters the js function expects, it's impossible to work it
out through reflection from Java. I'd be interested to learn otherwise.

ie javascript doesn't have parameter types.

Attila Szegedi

unread,
Feb 12, 2009, 5:19:01 AM2/12/09
to Patrick Dobbs, dev-tech-js-...@lists.mozilla.org
On 2009.02.12., at 11:10, Patrick Dobbs wrote:

> typeof(x) works from javascript, but if type info is needed then the
> sender of this thread post is presumably trying to call a function
> defined inside a js script from Java.

That was my impression too.

> Since javascript is untyped, I presume that if you don't know
> beforehand what type parameters the js function expects, it's
> impossible to work it out through reflection from Java.

That's correct.

> I'd be interested to learn otherwise.

I'm afraid you will not :-)

> ie javascript doesn't have parameter types.

Correct.

Attila.

Johan Compagner

unread,
Feb 12, 2009, 6:33:38 AM2/12/09
to dev-tech-js-...@lists.mozilla.org
you should be able to get the param count (and names)
But not the types thats impossible in js

But if you have the source then you can say that they have to specify the
type through the jsdoc @param tag..

Then a jsdoc parser in java is needed, and if you do find one please share i
also need one,
We are currently thinking just to rewrite some parts (the regexp) of the
jsdoc-toolkit to java
But if anybody has a better idea?
(would be a nice add on for rhino itself)

johan

On Tue, Feb 10, 2009 at 07:51, <vivek...@gmail.com> wrote:

> how to get parameter types of a javascript function compiled using
> rhino?????

> _______________________________________________
> dev-tech-js-engine-rhino mailing list
> dev-tech-js-...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
>

Michael

unread,
Feb 13, 2009, 6:47:02 AM2/13/09
to
On Feb 12, 11:33 am, Johan Compagner <jcompag...@gmail.com> wrote:
> you should be able to get the param count (and names)
> But not the types thats impossible in js
>
> But if you have the source then you can say that they have to specify the
> type through the jsdoc @param tag..
>
> Then a jsdoc parser in java is needed, and if you do find one please share i
> also need one,
> We are currently thinking just to rewrite some parts (the regexp) of the
> jsdoc-toolkit to java
> But if anybody has a better idea?
> (would be a nice add on for rhino itself)
>
> johan
>
> On Tue, Feb 10, 2009 at 07:51, <vivekoc...@gmail.com> wrote:
> > how to get parameter types of a javascript function compiled using
> > rhino?????
> > _______________________________________________
> > dev-tech-js-engine-rhino mailing list
> > dev-tech-js-engine-rh...@lists.mozilla.org
> >https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

You should post any questions like that on our JsDoc Toolkit user
list, it is more likely to get a proper answer. We are already
planning to use the (soon to be available?) AST feature of rhino to do
the static analysis work in the next major release of JsDoc Toolkit,
so you can possibly contribute to that if you are interested.

michael

Johan Compagner

unread,
Feb 13, 2009, 8:10:05 AM2/13/09
to dev-tech-js-...@lists.mozilla.org
> > On Tue, Feb 10, 2009 at 07:51, <vivekoc...@gmail.com> wrote:
> > > how to get parameter types of a javascript function compiled using
> > > rhino?????
> > > _______________________________________________
> > > dev-tech-js-engine-rhino mailing list
> > > dev-tech-js-engine-rh...@lists.mozilla.org
> > >https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
>
> You should post any questions like that on our JsDoc Toolkit user
> list, it is more likely to get a proper answer. We are already
> planning to use the (soon to be available?) AST feature of rhino to do
> the static analysis work in the next major release of JsDoc Toolkit,
> so you can possibly contribute to that if you are interested.
>
> michael
>

It was not directly a question more a remark triggered by something else :)

We are looking into jsdoc-toolkit, the problem is that it is written in js
(and i dont think this will change for jsdoc-toolkit or am i mistaken)
And we need to have somehting like that for our eclipse plugins
We currently are already using the rhino parser (a slightly modified version
because we need some more info)
for generation the eclipse ast tree. So yes it would be nice if jsdoc was
also parsed by the new rhino parser
that would be a very nice addition.

johan

Charles Lowell

unread,
Feb 14, 2009, 11:56:13 AM2/14/09
to

If they're planning on using the greatly anticipated AST api, I would
assume that at least some portions of it are going to be implemented
in java.

I'm also interested in analyzing comments(from java), but more for an
abstract annotation facility than for documentation specifically.

I'd be willing to contribute to anything that actually does this, or
collaborate on starting up something that eventually will do it. Is
that the plan for jsdoc-toolkit?

cheers,
Charles


0 new messages