typeof(x)
sorry
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.
> 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.
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
>
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
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