|
Converting AST to javascript source
|
| |
At the moment I'm using the AstRoot.toSource() method to generate my javascript files. But this is really slow for large js files on mobile devices (less memory), because toSource() is using a StringBuilder which holds the complete file. Is there a way to directly stream the js-code to an output file?... more »
|
|
JavaScript function invocation in Java Code
|
| |
I pass a function from JavaScript file into Java code. JavaScript function looks like:
entity.handler = function(arg1, arg2) {
//do something
...In Java code the class implements the Scriptable interface. And when I invoke the JavaScript, actually the following method is invoked in Java:... more »
|
|
Issue while Parsing JS files to retrieve JS function names.
|
| |
I am using Rhino 1.7R4 to parse JS files to retrieve function names. Using the following snippet to parse JS file. I have got this code from some of the posts in this group.
Reader reader = null;
try {
String file = "foo.js";
reader = new FileReader(file);
AstNode node = new Parser().parse(reader, file, 1);... more »
|
|
About embedding the Rhino parser
|
| |
Dear list, I'm a Rhino newbie and I have some basic questions. I'm sorry if they have already been answered but I've not been able to find them. I'm currently working on a project where we use Javascript as a programming language. We've build our own homemade parser and interpreters as we interpret the scripts in different ways to perform different use cases of... more »
|
|
Find out how many parameters a function has
|
| |
Is there a way to find out how many parameters are in a JS function? I can get access to the InterpretedFunction object representing the function, but I have no idea how to use it. The source code is vague, and the JavaDoc doesn't even exist! Thanks
|
|
Issue with XML.replace in E4X implementation?
|
| |
Hi, I think there is a bug in the E4X implementation XML.replace function: Rhino 1.7 release 2 2009 03 22 js> <xml><one/><br/><two/><br/><th ree/><br/></xml>.replace('br', '') <xml> <one/> <br/> <two/> <three/> </xml> js> AFAIK the code should remove all the <br/> nodes, but the first one remains. I also tested in FF3.6 and there the <br/> nodes are properly... more »
|
|
Eclipse integration & Classloader
|
| |
Hi all, I am experimenting with a rhino powered JavaScript shell for Eclipse 3.6. It was quite easy to get it running for pure JavaScript code. Now I am facing problems when I try to access Java classes through the LiveConnect feature. Accessing "Packages.something..." works only for Java classes of the JRE... more »
|
|
|