mozilla-xp.com | Post Question | Search | About | Groups | Contact | Register | Login



mozilla feedback firefox (6269)

mozilla feedback (2091)

mozilla feedback firefox prerelease (1989)

mozilla feedback companion ebay (1647)

mozilla feedback thunderbird (860)

mozilla support thunderbird (809)

mozilla support seamonkey (511)

mozilla dev tech crypto checkins (461)

mozilla support firefox (406)

mozilla support bugzilla (397)

mozilla dev extensions (359)

mozilla feedback thunderbird prerelease (334)

netscape public mozilla reviewers (272)

mozilla dev mdc feedback (270)

netscape public beta feedback (268)

netscape public mozilla crypto checkins (265)

mozilla dev apps thunderbird (252)

netscape public mozilla jobs (224)

mozilla dev tech plugins (194)

mozilla dev apps firefox (190)

mozilla dev tech xul (190)

mozilla dev apps calendar (187)

mozilla dev embedding (181)

netscape public mozilla embedding (177)

netscape public mozilla test (174)

netscape public dev xul (169)

mozilla dev planning (169)

mozilla support calendar (167)

mozilla dev tech js-engine rhino (165)

netscape public mozilla layout xslt (164)

mozilla test (163)

netscape public mozilla jseng (160)

netscape public mozilla crash-data (159)

netscape public mozilla xpcom (159)

mozilla dev platform (158)

mozilla dev platforms mobile (157)

mozilla marketing (156)

netscape public mozilla webtools (155)

mozilla jobs (153)

mozilla dev builds (153)

mozilla dev tech xpcom (150)

mozilla support webtools (148)

mozilla dev accessibility (147)

netscape public mozilla calendar (146)

netscape public mozilla xml (138)

mozilla dev tech java (136)

netscape public mozilla gtk (136)

mozilla community drumbeat (135)

mozilla dev tree-management (131)

mozilla dev apps bugzilla (130)

netscape public mozilla i18n (130)

netscape public mozilla prefs (129)

netscape public mozilla qa general (129)

mozilla dev amo (128)

netscape public mozilla general (127)

netscape public mozilla rdf (126)

netscape public mozilla xpinstall (126)

netscape public mozilla xpfe (123)

netscape public mozilla plugins (122)

netscape public mozilla java (122)

netscape public mozilla ui (119)

netscape public mozilla accessibility (118)

netscape public mozilla wishlist (117)

netscape public mozilla mac (116)

mozilla dev tech js-engine (116)

mozilla dev apps seamonkey (116)

netscape public mozilla crypto (112)

netscape public mozilla mathml (112)

mozilla dev tech crypto (111)

netscape public mozilla beos (111)

netscape public mozilla jsdebugger (110)

netscape public mozilla license (109)

netscape public mozilla qa browser (109)

mozilla wishlist (108)

mozilla dev quality (107)

mozilla dev tech xforms (106)

netscape public mozilla directory (106)

netscape public mozilla editor (106)

netscape public mozilla macosx (106)

mozilla dev apps js-debugger (105)

netscape public mozilla performance (103)

netscape public mozilla builds (100)

mozilla dev ports os2 (100)

netscape public mozilla qt (98)

netscape public mozilla mail-news (97)

mozilla announce (96)

netscape public mozilla documentation (94)

netscape public mozilla os2 (93)

netscape public mozilla nspr (93)

netscape public mozilla netlib (93)

netscape public mozilla style (92)

mozilla support planning (92)

netscape public mozilla patches (91)

mozilla dev l10n web (91)

mozilla dev tech nspr (89)

mozilla dev mdc (87)

mozilla dev tech network (87)

mozilla dev tech css (86)

mozilla dev l10n (86)

mozilla dev l10n cs (85)


mozilla.dev.tech.js-engine.rhino Post New
Items(165) /2 Next >> Last >|
Subject Posted Replies From
RE: Scope and Multithreading

Yes, there should not be a problem with this, as a scope is essentially just a container. Multiple scripts can be executed under one scope simultaneously as well. All presuming, as you stated, that the objects are immutable or you have made them thread safe yourself (Rhino does not make any effort to make the access to your objects thread safe, that will be your job). David -----Original Message----- From: dev-tech-js-engine-rhino-bounces+davidparks21=yahoo.com@lists.mozilla.org [mailto:dev-tech-js-engine-rhino-bounces+davidparks21=yahoo.com@lists.mozilla.org] On Behalf Of

3/12/2010 12:41:47 AM 0 David Parks <davidpark...@yahoo.com>



[announce] RingoJS 0.4

We're happy to announce the release of RingoJS 0.4. RingoJS (previously called Helma NG) is a thin wrapper around Rhino providing a CommonJS conformant module library and web application framework. If you are using Rhino and are interested in CommonJS, this might be worth checking out. http://ringojs.org/wiki/Release%200.4/ Since 0.3, most notably CommonJS compliance was pushed on and the web application modules fleshed out or improved. Lower level enhancements include optimizations regarding code caching, resource loading and bringing in the new ECMAScript 5 and JavaScript 1.8 fe

3/10/2010 10:51:33 AM 0 Hannes Wallnoefer <hann...@gmail.com>
Add instrumentation to standard objects

Hi there, I would like to add some instrumentation to some standard objects like native string and array to monitor some events like string concatenation, array insertion? what is the best way to do it without patching Rhino? does the following code solve the problem? -------------------------------------------------- ScriptableObject.defineClass(scope, MyPkg.String.class); ScriptableObject.defineClass(scope, MyPkg.Array.class); -------------------------------------------------- Thanks. Arthur

3/9/2010 5:50:09 PM 0 xuesong chen <xuesongchen...@msn.com>
Code Assist based on Rhino1.7R3

Hi I'm currently implementing an Eclipse Javascript Editor which should provide code assist functionality, e.g. a list of available methods/ fields and parameters. Since Rhino1.7R3 should be released with the new AST API I checked the source code on how I could extract the JAVA type that underlies my javascript variable. The JAVA types are mostly out of external JAVA packages. In principle a user should be able to click anywhere in the code, and I would based on the offset determine the AST element and resolve the JAVA type - to extract the list of available members. Based on the r

3/8/2010 3:55:01 PM 0 sro <...@ini.phys.ethz.ch>
E4X filter scope

This is a cryptographically signed message in MIME format. --------------ms070807080206010003020402 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable It's my understanding from ECMA-375, 2nd edition, section 11.2.4, that=20 given xml =3D <xml><e id=3D"1"/><e id=3D"2"/></xml>; the following code xml.*.(@id =3D=3D "1") (which returns the <e id=3D"1"/> element) could also be written as xml.*.(attribute("id") =3D=3D "1") I.e., not only the node's properties but also its methods should be=20 available to the filters

3/6/2010 2:37:28 PM 0 Martin Blom <mar...@blom.org>
Is Parser.parse thread safe?

Hi guys, Simple question: in 1.7R2, can I make a single instance of Parser and call its "parse" method from multiple threads, or do I need to guard calls to that method with a lock? Thanks, A

3/5/2010 10:54:46 PM 2 wolffiex <awo...@gmail.com>
How to instantiate java inner class from rhino?

Hello, while working with rhino i have to make use of some given java objects. Unfortunatly these objects have a quite strange design and so i ran into the following problem: How to instantiate a java inner class from within rhino scripting? In pure Java it is OuterClass.InnerClass innerObject = outerObject.new InnerClass(); but when i try something similar with rhino it fails importClass(org.some.Class); importClass(org.some.Class.Inner); var class = new Class(); var inner = class.new Inner(); I was searching the docs but couldnt figure if it is possible at all? Tha

3/4/2010 9:14:04 AM 0 Someone <binge...@ifao.net>
would it be possible to share the InterpreterData objects?

Hi, We have 2 kind of clients, 1 is a swing client and there there is not really a problem But the other is a web client that runs on the server There we can have for example 10 clients and if i look what the total InterpreterData object size is for those 10 clients is is that 75MB mem usage But that is pretty much all the same kind of data. So if i could share that then that would be 7.5MB of total of InterpreterData objects that then is reused by a InterpretedFunction function that is tied to a specific client. The question is does InterpreterData has changing state? Or is i

3/3/2010 12:36:09 PM 0 Johan Compagner <jcompag...@gmail.com>
how to load js libraries in an embedded rhino application?

Hello, How does one load a library such as jQuery or prototype into the rhino context when running as an embedded app within a java program? I am using Java 6, rhino 1.7R2. I can totally run functions and eval arbitrary code, but I cant find any documentation or even class files in the source tree that scream to me "use me to load libraries". So what class/method in Rhino actually satisfies the load (file) semantics in the command line? Thanks for your attention! Sachin

3/2/2010 4:39:15 PM 3 doles <sachin.d...@gmail.com>
Rhino version from jar

Hi guys, Does anyone know if it's possible to retrieve the version number from the jar? I had a look through the documentation but couldn't find anything. Any help would be much appreciated. Thanks, Sam

3/2/2010 4:20:39 PM 0 Sam Howard <...@idrsolutions.com>
Rhino Thread Safety

Hello, I am new to Rhino, and I want to make sure I understand how it works in mul= tithreaded environment. In particular, I have a java class that wraps a Jav= aScript expression, and I hope it is thread safe. I would really appreciate= if someone with more experience can confirm it is thread safe, or point to= things to change in order to make it thread safe. I am using Rhino version that comes with Weblogic 10.0.1 (I think I read so= mewhere it is a modified 1.6R4). Please note the following constraints which should help with thread safety: - objects put into share

3/1/2010 2:40:39 PM 0 Aleksandar Likic <ALi...@loyalty.com>
how should I create XML?

This is a multi-part message in MIME format. --------------040209040205070201040202 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi All, I'm trying to run the following shippet: import org.mozilla.javascript.Context; public class JSSnippet { public static void main(String[] argv) throws Exception { Context cx = Context.enter(); try { String script = "" + "var xml = <root><node1/><node2/><node3/></root>;" + "for (var node in xml.*) {" + " java.lang.System.out.println('>

3/1/2010 1:27:21 PM 2 Alex <a...@alex.com>
run strophe on rhino ontop of GAE

have anyone success in running strophe on rhino ontop of GAE and use strophe to connect to external BOSH? Will that be possible?

2/27/2010 6:45:57 AM 0 Coolzy <second.co...@gmail.com>
rhino licensing

any future plan for rhino to change licensing to lgpl? currently it is gpl, also mean if we use it we required to open source our application right?

2/26/2010 12:41:44 PM 3 Coolzy <second.co...@gmail.com>
Looking elsewhere for Messages.properties

Hi, all. Wondering if I might get a better response here than I have in the various Android forums I've poked, especially since I'd rather create a fix that works for everyone than fork Rhino just so it works for me. As has been implied, I'm using Rhino to script an Android app. I had various issues with this under 1.6 which I fixed, but the one that keeps coming back to bite me is Messages.properties' location. Specifically, ScriptRuntime hard-codes this to a class, then stores Messages*.properties in the jar. This seems like a good solution until Android steps in and re-i

2/23/2010 6:09:16 PM 0 Nolan Darilek <no...@thewordnerd.info>
OptionalDataException during deserialization

Hello folks, I am using Rhino 1_7R3pre CVS (also 1_7R2) with Java 1.6. In order to preserve and later restore an entire JS scope, I use serialization: first I serialize the given scope and then I deserialize it obtaining a duplicate of that scope. The problem is that I always receive an OptionaDataException during deserialization. It seems to me that some kind of bug is present in the following methods: ScriptableObject.readObject ScriptableObject.writeObject ScriptableObject.accessSlot I cannot post my code but: 1- accessSlot increments the field "count" without pu

2/19/2010 3:25:41 PM 0 Cuffia <claudio.des...@gmail.com>
Java hosted module script provider for CommonJS

Hi, I am opening a new thread related to CommonJS. I just have created and uploaded new patch, https://bugzilla.mozilla.org/show_bug.cgi?id=547071. In contains initial implementation of Java hosted module script provider. It is really basic implementation based on one of my previous posts. If you like this idea let me know and I will spend more time on making this implementation more clean and expendable. Let me know your thoughts and ideas. Regards, Jarek

2/18/2010 10:22:00 PM 0 =?ISO-8859-2?Q?Jaros=B3aw_Pa=B3ka?= <jpa...@gmail.com>
HTTP basic authentication

HI, everyone does anyone know how to use readUrl to pass HTTP basic authentication ? or any other ideas? thanks.

2/18/2010 1:48:18 AM 0 "peggy" <peggy...@hotmail.co.jp>
JavaAdapter on Android

Hi all, I am experimenting with Rhino on Android (interpreted mode), and I have run into a show-stopper. When using the JavaAdapter constructor to extend a Java class, it seems from the stack trace, that Rhino generates byte codes, which then can not be loaded on Dalvik (the Android VM). Any workaround for this? The ideal solution is to generate Dalvik byte code, but this is a too complex undertaking for me right now. One fix is to write wrapper classes in Java that delegate to JavaScript objects, but this is a rather clumsy and non-general solution, and time consuming to imple

2/16/2010 7:58:03 PM 0 Mikael Kindborg <mikael.kindb...@gmail.com>
Java 5.0 enum

Hi all, sorry if this question is trivial... but I don't know how to deal with this in js, and specifically in rhino shell... Say, I have an enum like enum Cardsuit { CLUBS, DIAMONDS, SPADES, HEARTS } how do I use it in Rhino? Thx jg

2/16/2010 4:14:42 PM 0 jg <jgrand...@gmail.com>
__proto__ not working?

I seem to be in a pickle on this one (from the Rhino shell): js> function A() { > } A.prototype = { foo: "Quack", }; [object Object] js> function B() {} B.prototype = { __prototype__: A.prototype, bar: "Foo", }; [object Object] js> foo = new B(); [object Object] js> print (foo.bar); Foo js> print(foo.foo); undefined js> foo.__prototype__; [object Object] js> foo instanceof A; false Not quite sure what's going on here as this works in the Mozilla JS engine (i.e. the browser). Can someone suggest a better way to perform a.) inheritance and b.) making sure that things suc

2/16/2010 3:28:51 PM 0 John-Simon <jsp...@gmail.com>
read xml on rihno

hi, everyone, does any one know how to read xml file on rihno? thanks

2/15/2010 5:23:39 AM 0 "peggy" <peggy...@hotmail.co.jp>
Rhino Security Policy File

I am kind of new to rhino. I am using a rhino based scripting framework in a servlet environment. I would like to run untrusted javascript code and so would like to restrict the code with a security manager. Does anyone have a basic security policy file to start with, or a list of permissions rhino needs. Or maybe a suggestion about how to go about accomplishing this? Thanks for any advice. Tony

2/13/2010 2:35:42 AM 0 Tony Zakula <tonyzak...@gmail.com>
Rhino and LET statement support

I've been trying to run a number of js files from someone else with Rhino and they seem to be croaking on LET statement support. A simple example: js> function myFunc() { > let x = 31; js: "<stdin>", line 8: missing ; before statement js: let x = 31; js: .....^ I I've tried this with the 1.6 release in Java 1.6 (expected fail) and on the 1.7R2 release with the same behavior. Does Rhino not support this language feature? Thanks, John

2/12/2010 8:24:20 PM 0 John-Simon <jsp...@gmail.com>
NullPointerException in Function.call method

Hi, I have a problem where I sometimes get a NullPointerException when calling the call-method of the Function-class in rhino. The case is that we are running a J2EE-application inside JBOSS application-server, a couple of Scripts are compiled using Context.compileReader and then cached in memory, script-functions are then called using the Function.call-method. This normally works fine but sometimes the Function.call gives a NullPointerException without further info. When this happens the Script stops working, always returning NullPointerException when Functions are called unti

2/12/2010 2:31:07 PM 0 Anders <andersbell...@gmail.com>
Disable some instructions

Hello ! I'm wondering if there is a way to disable some instructions in the engine. For an example, I want to disable the use of the for loop in my scripts... Is there a simple way to do this ? Thank you in advance for your answer ! Best regards !

2/9/2010 4:28:50 PM 0 Piziwate <steve.jacot-guillar...@swissdotnet.ch>
Envjs html parser silently fails to load without -opt -1

We had this problem before but because the entire project was nearly 63KB in a single closure I felt like it was related to the 64KB limit for single functions. We recently did a big refactor so the dom, events, html, parser, timer, xhr, and window are each seperated and have clearer dependencies on each other. Unfortunately, loading the parser at any point (which is about 32KB) still causes a silent failure that goes away with -opt -1. I realize I can set the optimization level internally to hide this requirement from the end user but I'm still a little perplexed why it wont comp

2/6/2010 4:17:52 PM 0 Thatcher <thatcher.christop...@gmail.com>
Announcement: JavaScript support in Spring

I have made bug fixed, improved, multi-thread safe, spring 3.0 compatible JavaScriptFactory "on steroids". Description, source, examples: https://jira.springsource.org/browse/SPR-1933 It is Rhino javascript support for Spring framework (core, not mvc). Spring supports out-of-box BeanShell, JRuby and Groovy. With JavaScriptFactory you can write your Spring beans in Javascript. I am Rhino newcomer (just do migration from BeanShell to Rhino), so some code review will be helpful. PS: Announcement in Russian (with more examples): http://community.livejournal.com/ru_java/901310

2/5/2010 9:13:41 AM 0 "Andrey P.Rybin" <apr...@gmail.com>
Line numbers in errors don't get populated

Hi there, I have some confusing behaviour where Rhino isn't producing line numbers in errors when a type error is generated (e.g. trying to call a method on an object that doesn't exist). When running a simple standalong helloworld app that runs a script I see the line numbers in the errors in both interpreted and compiled mode. And in interpreted mode I also see the JS function names in stack traces. e.g. the error might be like: TypeError: Cannot find function xyz in object MyObj. (script#21) and the relevant part of the stack: at org.mozilla.javascript.ScriptRunt

2/3/2010 8:54:13 AM 0 Matt Doran <mattdora...@gmail.com>
implementing ActionListener exception: Interface or Abstract

Hi there, I keep seeing the following error while trying to implement an actionlistener: "org.mozilla.javascript.EvaluatorException: error instantiating (Wrapped java.lang.NullPointerException (test.js#5)): class java.awt.event.ActionListener is interface or abstract (test.js#5)" Can anybody see what's wrong with my code below? Thanks! [ script ] function Test() { var btn = new javax.swing.JButton("Test"); var obj = { actionPerformed: function() { javax.swing.JOptionPane.showMessageDialog(null, "test"); } } var al = new java.awt.event.ActionListener(ob

1/29/2010 11:59:23 AM 0 "usr1" <u...@live.nl>
ClassCache Map Thread Safety?

We are trying to resolve an issue where the Rhino engine occasionally gets stuck early in the run. =20 We use a shared sealed global scope, and create scripts that execute in multiple threads, inheriting the core objects from the single shared global scope. =20 =20 Under load, it looks like the HashMap instances in org.mozilla.javascript.ClassCache get corrupted. We get a code thread hung in this code below, and all the other threads waiting for this guy to give up a synchronization lock. =20 We are trying the use of ConcurrentHashMap instead of HashMap inside the Cla

1/25/2010 8:03:48 PM 0 "Tom Palkot" <tpal...@motive.com>
Converting a Java date into a JS date (from within Java)

Hi there, I'm embedded Rhino into our application (for end user scripting), and I'd like to expose some dates into Javascript so that it feels as native as possible (i.e. they are JS date objects, not java.util.Date). Rhino doesn't seem convert the Java date type into the native JS type. So only the java date methods are available to the user. I'm happy to manually instantiate a "native" Javascript object, but how do I do this from Java? The NativeDate type is package protected, and I can't see any obvious way to do this. Thanks in advance, Matt

1/24/2010 3:54:11 AM 0 Matt Doran <mattdora...@gmail.com>
Input validation in Rhino ?

Hi all , Does rhino does any type of input validation or provide some interface or other way so that we can validate input ( like read from some xml file) ? In case such service exists in rhino, please provide information regarding that. I would be very thankful to you. Thanks, Rajat

1/22/2010 6:23:25 AM 0 Rajat Gupta <innocent_pers...@yahoo.com>
Top level class "alias"

Hello, I'm currently inserting text like this before compiling my script: "Bar = Packages." + foo.Bar.class.getName() + ";\n" + theScriptToRun as a way to "alias" the Bar class. I'd prefer not to do it this way. I'm currently trying to do this: final FunctionObject functionObject = new FunctionObject("Bar", Bar.class.getConstructor(), scope); ScriptableObject.putProperty(scope, "Bar", functionObject); The first line is failing with: org.mozilla.javascript.EvaluatorException: Construction of objects of type "foo.Bar" is not supported. My ClassShutter allows access to foo.

1/19/2010 9:05:55 PM 0 Daryl Stultz <da...@6degrees.com>
CommonJS Modules in Rhino

Folks, I'm contemplating adding CommonJS Modules implementation to Rhino = codebase proper. I'd create org.mozilla.javascript.commonjs package to = hold it, and we could have a method similar to initStandardObjects(), = i.e. initCommonJs() that'd initialize it - basically install a require() = function with the expected semantics in the top-level scope. I want = leave some of its aspects - most notably lookup of the module script - = pluggable, defined by interfaces in the org.mozilla.javascript.commonjs = package, so that specific embeddings of Rhino (JS app servers) can = install

1/17/2010 6:35:39 PM 24 Attila Szegedi <szege...@gmail.com>
context.compileScript return proper value even for non proper scripts

hi, i am trying the context.compileSrting() function but i am getting a return value whether the script is valid and if not. how can i make compilieString signal when the script is invalid? please advise thanks

1/17/2010 1:45:32 PM 0 Jaimon <kal.liz...@gmail.com>
sync and spawn

hi, i do this test. from the result, it seems use one thread to sync two function. but why the result have one undefined msg... must use spawn by many thread? if use many thread , how can i know if error in one thread... thanks. test example: var obj = { thread1 : sync(f)}; function f(a, b) { java.lang.Thread.sleep(2000); print(a + ";" + b); var threadName = java.lang.Thread.currentThread().getName(); var threadID = java.lang.Thread.currentThread().getId() print(threadID + "-" + threadName); } obj.thread1(f(1, 2)); ob

1/15/2010 2:57:56 AM 0 "peggy" <peggy...@hotmail.co.jp>
VariableDeclaration.toSource() to end with semicolon

Hi all,=0A=0AWith CVS version, the below code outputs "var x =3D 1=A0 x =3D= x + 1;" which I believe is incorrect.=0A=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 Parser p =3D new Parser(); =0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 AstRoot= ast =3D p.parse("function foo() {var x =3D 1; x =3D x + 1}", "<cmd>", 0); = =0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 FunctionNode f =3D (FunctionNode) ast.= getFirstChild();=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 System.out.println(f.t= oSource());=0A=0A=0AIf "var" was removed, then the output is=0A=0A=A0 x =3D= 1;=0A=A0 x =3D x + 1;=0A=0A=0A=0AThe reason is Variabl

1/14/2010 10:08:48 PM 0 Ahmed Ashour <asash...@yahoo.com>
Javascript hijacking with setters

Greetings, I have a question about getters and setters in prototypes, which are used in the XSS attacks, and probably are depreciated or removed from Rhino and Javascript . E code snippet: // override the constructor used to create objects so // that whenever the "email" field is set, the method // captureObject() will run. Since "email" is the final field, // this will allow us to steal the whole object. function Object() { this.email setter = captureObject; } This example is taken from : www.fortify.com/servlet/download/public/JavaScript_Hijacking.pdf, where that kind of XS

1/13/2010 3:47:08 PM 0 =?ISO-8859-2?Q?Tadeusz_S=B3upski?= <tadz...@sbcglobal.net>
open source javascript code hightlight textarea..

hi, i am working with rhino and i would like to replace the Jtextarea that i write my script, to something that hightlights the script. any one knows any open source that does this job? thanks

1/7/2010 1:54:43 PM 0 Jaimon <kal.liz...@gmail.com>
Delegator and StackOverflowError

Hi, I tried to use Delegator class to implement some functionality on variable assignment. I have my object that implements Scriptable and would like to call additional functionality when instances of this objects are assigned to variable. Here is a part of my JUnit test for this class. final Context context = ContextFactory.getGlobal().enterContext(); final ScriptableObject scope = context.initStandardObjects(); final Delegator delegator = new Delegator(scope); ScriptableObject.putConstProperty(delegator, "imports", new ImportsObject(

1/6/2010 1:36:48 PM 0 =?ISO-8859-2?Q?Jaros=B3aw_Pa=B3ka?= <jpa...@gmail.com>
Ast FunctionNode types

What classifies in AST package (if it makes a difference) as a FUNCTION_EXPRESSION vs FUNCTION_STATEMENT vs FUNCTION_EXPRESSION_STATEMENT? I have a list here on various function statements. function foo() {} foo = function() {} foo = new function() {} foo : function() {} What would these be classified? Also would it make a difference if they were being used as closure?

1/6/2010 6:42:01 AM 0 NeoAlchemy <neoalch...@gmail.com>
org.mozilla.javascript.EcmaError: ReferenceError: "ByteString" is not defined.

when exec js in java got the errors ,wonder why got such error and how to solve them thanks!

1/5/2010 6:35:46 AM 0 terry <u...@mozilla-xp.com/>
Status and Future of Rhino

What is the current status of Rhino? Is it still being developed,updated, etc? What does the future hold for Rhino? I was looking at the latest release of Rhino and it seems to still only support Javascript 1.7. Will it support Javascript 1.8 in the near future? What about Ecmascript 5th Edition? Thanks, Travis

1/4/2010 3:26:26 AM 2 Travis Ennis <travis.en...@gmail.com>
creating a java outputstream object and converting it to a javascript object

I am trying to use Henri Sivonen's excellent htmlparser written in java from rhino I have gotten stuck using the HtmlSerializer constructor which needs an Outputstream object. nu.validator.htmlparser.sax.HtmlSerializer HtmlSerializer(OutputStream out) I am quite ignorant when it comes to java. Can anyone tell me the easiest way to create an Outpustream object and convert it to a regular js object? I much appreciate the help Here is a link to the function I am trying to use http://about.validator.nu/htmlparser/apidocs/nu/validator/htmlparser/sax/HtmlSerializer.html#HtmlSeriali

1/3/2010 5:04:39 AM 1 bryanwb <br...@olenepal.org>
JSON.parse() problem

Hello, I am doing some tests with the CVS version of Rhino 1.7R3, and I am running into an issue with the JSON native object. The problem involves the object returned when parsing a dictionary, if the keys happen to be (string representations of) numbers. More specifically: js> var o1 = {"a": 100} js> var o2 = {"1": 100} js> var s1 = JSON.stringify(o1) js> var s2 = JSON.stringify(o2) js> s1 {"a":100} js> s2 {"1":100} So far, so good. js> var n1 = JSON.parse(s1) js> var n2 = JSON.parse(s2) js> n1["a"] 100 js> n2["1"] js> typeof(n2["1"]) undefined The value with

12/31/2009 4:56:07 PM 3 Christian Grigis <christian.gri...@nexthink.com>
Caching wrapped objects in custom WrapFactory

In implementing a WrapFactory I noticed that objects were being wrapped multiple times (probably every time accessed). This thread: http://www.mail-archive.com/dev-tech-js-engine-rhino@lists.mozilla.org/msg00468.html is a discussion of caching the wrapped objects. It uses terms like "weak reference" which scares me, I'm likely to produce a memory issue. I'm wondering if it would help performance or if the reflection lookup work is already being cached. IOW, is caching at the WrapFactory worth the performance improvement, if any? Thanks. -- Daryl Stultz _____________________

12/31/2009 4:15:52 PM 0 Daryl Stultz <da...@6degrees.com>
Alias class names

Hello, I'm familiar with this: ScriptableObject.defineClass(scope, long.path.name.MyEntity.class); which puts MyEntity at the top level, perhaps with a name "Entity". MyEntity must be Scriptable. I'd like to do the same with classes that aren't scriptable. Currently I stick code at the front like so: String imports = "Entity = Packages." + long.path.name.MyEntity.class.getName() + ";\n"; String fullScript = import + originalScript; executeScript(fullScript); Kinda gross. I think I'd like to do something like this: ScriptableObject.putProperty(scope, "Entity", yaddayadda)

12/31/2009 2:36:27 PM 0 Daryl Stultz <da...@6degrees.com>
Object equality

Hello, Neither == nor === invokes equals() on my Java objects. Should I expect either to return true? Obviously obj1.equals(obj2) works as expected. Sorry my JavaScript is not so good. Is there some method I need to implement to control how == works? Thanks. -- Daryl Stultz _____________________________________ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:daryl@6degrees.com

12/31/2009 2:00:04 PM 0 Daryl Stultz <da...@6degrees.com>
Unwrap Factory?

Hello, I've experimented with WrapFactory. I understand how/when a Java object gets wrapped into a Scriptable object. When I access my domain object I get a wrapped object. The problem is when I go to set a value of the domain object with another domain object. The new value will be a wrapped object. It's a headache but not unmanageable to unwrap the new value. The big problem is when dealing with collections. Consider this Java: public class DomainEntity { private DomainEntity parent; private List<DomainEntity> children; ...getters/setters for parent and children } public c

12/30/2009 6:34:09 PM 0 Daryl Stultz <da...@6degrees.com>
RHINO USAGE WARNING: Missed Context.javaToJS() conversion:

Hello, I have the following code: function myFunction(object1) { var object2 = object1; object2 == object1; } That produces this warning: RHINO USAGE WARNING: Missed Context.javaToJS() conversion: Rhino runtime detected object Foo@eb2f0 of class Foo where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call. Anyone know what I'm supposed to do? object1 and object2 are Foo classes, of course, wrapped to be Scriptable. Thanks. -- Daryl Stultz _____________________________________ 6 Degrees Sof

12/30/2009 5:32:50 PM 0 Daryl Stultz <da...@6degrees.com>
Host object vs wrapped

Hey all, I've been using Rhino for some time now in my application. I simply use POJO objects and let them get auto-wrapped by Rhino. I've been reading the docs about host objects and I seem a bit unclear what the purpose is. I don't see what the benefit of writing public void jsFunction_resetCount() vs just public void resetCount(). Is it just the ability to add dynamic properties to an object? Ultimately I'm looking for a better solution to my application design. I've got a domain object, say MyEntity and a wrapper class called JsMyEntity that forwards methods to MyEntity

12/26/2009 2:27:42 AM 0 Daryl Stultz <da...@6degrees.com>
About the output of the UTF-8 file

Hello C:\>type file.js importPackage(java.io); var file = new PrintWriter( new BufferedWriter( new FileWriter("sample.txt")), "UTF-8"); file.println("For example Multibyte String"); file.close(); C:\>rhino Rhino 1.7 release 2 2009 03 22 js> load("file.js"); Then the "java.io.BufferedWriter@16f8cd0" file that "For example Multibyte String" was described is output, and sample.txt of 0kb is output -------------------------------------- Get Disney character's mail address on Yahoo! Mail http://pr.mail.yahoo.co.jp/disney/

12/18/2009 4:17:59 AM 0 sider2jp <sider...@yahoo.co.jp>
basic questions for Rhino

hi, I am running into some problems and I was wondering if anyone can shed some light for me. What I am trying to achieve: Call Java class's method from Javascript What I did so far: 1) I downloaded rhino1_7R2 2) added js.jar (this was located right under directory rhino1_7R2) to my project library 3) created fooclass with ScriptableObject Problems I am getting I am getting an error var pn = new Packages.foo.foo.fooclass(); Error message from FireBug: uncaught exception: Error calling method on NPObject! [plugin exception: java.lang.ClassNotFoundException: foo.foo.fooc

12/17/2009 6:19:55 PM 2 Daniel Kim <danielkim...@gmail.com>
basic questions for Rhino

What I am trying to achieve: Call Java class's method from Javascript What I did so far: 1) I downloaded rhino1_7R2 2) added js.jar (this was located right under directory rhino1_7R2) to my project library 3) created fooclass with ScriptableObject Problems I am getting I am getting an error var pn = new Packages.foo.foo.fooclass(); Error message from FireBug: uncaught exception: Error calling method on NPObject! [plugin exception: java.lang.ClassNotFoundException: foo.foo.fooclass]. Disclaimer: Pardon me if this question might be too simple to ask on this forum.. Any hel

12/17/2009 5:48:06 PM 0 javanewbie <danielkim...@gmail.com>
Arguments's toString changed due to ES5?

Hi, due to changes in Rhino Head, toString() on an Arguments object now returns "[object Arguments]" whereas it was correctly returning "[object Object]" in earlier Rhino versions. Is this changed due to ES5 support? I couldn't find anything in the spec motivating it. Cheers, Marc

12/16/2009 4:14:27 PM 2 Marc Guillemot <mguille...@yahoo.fr>
stopping the script evaluation in DebugFrame

hi, i am working with rhino and now i am adding the debug to my implementation. my question: once i got to one of the DebugFrame methods i need to update the UI and wait for the user to tell me how to proceed (resume, terminate) is it possible to stop/terminate the script evaluation so i will be able to update the UI? i would rather not use the observeInstructionCount. is there any better way to stop or suspend the script evaluation? thanks me

12/16/2009 3:14:04 PM 1 Jaimon <kal.liz...@gmail.com>
null != undefined. Where have I gone wrong? Solution.

In the following code, I generate a new context, new scope, and evaluate some script, which results in Something Bad: public boolean createContext( boolean bAllowJavaImports, boolean bDynamicScope ) // false and false { m_context = Context.enter(); m_context.setErrorReporter( new ErrorHandler() ); resetScope( bAllowJavaImports /*false*/); // m_scope = m_context.initStandardObjects( null ); m_context.setLanguageVersion( Context.VERSION_1_2 ); m_context.setGeneratingDebug( true ); // true or false, same results DEBUG_STUFF(); }

12/14/2009 9:23:47 PM 0 Mark Storer <mstorer3...@gmail.com>
help needed: exception while importing package

Hi All, The question might be very fundamental but please bear with me as I'm new to Script support in jvm. I tried to import package oracle.tip.pc.services.translation.framework using importPackage(oracle.tip.pc.services.translation.framework); But, I got the following exception. javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "oracle" is not defined. (<Unknown source>#3) in <Unknown source> at line number 3 at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:110) at javax.script.AbstractScriptEngine.

12/11/2009 10:11:24 AM 2 Deepak Agarwal <deep...@gmail.com>
Odd/fundamental JS bug, using 1.7r2

My Script: function DEBUG_NOTE( msg ) {...} // stuffs a message into our database log var obj = new Object(); DEBUG_NOTE( "obj.foo = " + obj.foo ); DEBUG_NOTE( "obj.foo == null " + (obj.foo == null) ); DEBUG_NOTE( "!obj.foo " + !obj.foo ); obj.foo = null; DEBUG_NOTE( "obj.foo = " + obj.foo ); DEBUG_NOTE( "!obj.foo " + !obj.foo ); My Output: obj.foo = undefined // as it should be obj.foo == null false // THATS not good !obj.foo true // okay obj.foo = null // okay !obj.foo true // okay "undef == null" is required by the spec (11.9.3) to be true, yet my script's test of s

12/9/2009 8:34:32 PM 0 Mark Storer <mstorer3...@gmail.com>
Maven + Rhino = JAR

Hi guys, I'm not really familiar with Rhino but I want to compile .js source files via a maven plugin to a (bytecode) JAR (so that I can load it in OSGi and call it from another JAR). So far I couldn't find any clues on how to compile JS to JAR with maven. Any ideas? kind regards, stephanos

12/9/2009 11:55:17 AM 1 stephanos <stephan.beh...@googlemail.com>
How to speedup rhino?

1, speedup function(method) call public class TestQuickFunctionCall extends TestCase { public static interface IQuickIdCallObject { public Object execIdCall(int methodId, Context cx, Scriptable scope, Scriptable thisObj, Object[] args); } public static class QuickIdCallFunction extends ScriptableObject implements Function { private static final long serialVersionUID = 1L; IQuickIdCallObject obj; int methodId; public QuickIdCallFunction(IQuickIdCallObject obj, int methodId) { this.obj = obj; this.methodId = methodId; } @Override publi

12/9/2009 1:55:32 AM 0 goodzhu_china <baobeil...@gmail.com>
Memory leak...

I am using Rhino to compile and run .js files from within a servlet. When I hit the servlet from a browser several times, I see each execution creates one or may be more instances of java.lang.ref.Finalizer and never releases it. When I took a heap dump and analyzed it with Eclipse Memory Analyzer I see each java.lang.ref.Finalizer refers to another instance of Finalizer like a chain: java.lang.ref.Finalizer -> java.lang.ref.Finalizer - > java.lang.ref.Finalizer -> java.lang.ref.Finalizer -> and so on. Also, each java.lang.ref.Finalizer would also refer to a FileInputStream

12/7/2009 4:51:58 PM 1 Keith <khnichol...@gmail.com>
providing custom ErrorReporter implementations..?

Hi.. I'm prototyping an automated javascript validation tool based on Rhino.. hence a theoretical question: would it be possible to get the following patch accepted to Rhino main branch (anyway.. are the actual developers of Rhino also on this list..? I assume yes..) ok, the idea is that you have a nice interface ErrorReporter through which all the parsing/evaluating exceptions/errors are reported (nice design, btw:). What is happening currently is: 1) Main#exec sets the errorReporter: errorReporter = new ToolErrorReporter(false, global.getErr()); shellContextFactory.setError

12/7/2009 12:56:26 PM 0 =?ISO-8859-1?Q?Sander_S=F5najalg?= <san...@zeroturnaround.com>
Templating (Parser hack)

Hi, I'am planning on using Rhino as a replacement for JSP, soo I've hacked the parser adding a optional feature to enable a similar syntax: -- cut -- %><h1>Title</h1> <ul> <% for (var i = 1; i <= 10; i++) { %> <li>Item #<%= i %></li> <% } %> </ul> -- cut -- Now some questions: 1. Is anyone else interested is such a feature? 2. Would such a feature, properly implemented, ever be accepted to the main trunk of the Rhino source? 3. If yes. Any tips on how to correctly implement this? I've now just added an additional token '%>template text<%', the parser then creates

12/5/2009 12:33:55 AM 4 Henrik Lindqvist <henrik.lindqv...@llamalab.com>
running web scriptrs with rhino

Hi! I have a small question concerning Rhino.. namely, i would like it to run javascripts from webpages with it, but i can't as it doesn't have the objects predefined in browsers like "navigator", etc. Is there any way to work around this? Has Rhino really never been used in web context (i mean, for the very task javascript was invented for => manipulating DOM trees)? (Let me briefly explain: for what i'm trying to do, it doesn't really have to **work** (yeah that sounds ironic : D)... i mean.. i would like to *simulate* the way browser runs javascripts, and i'm really interested onl

12/4/2009 11:22:52 AM 0 =?ISO-8859-1?Q?Sander_S=F5najalg?= <san...@zeroturnaround.com>
JavaScript Objects and Garbage Collection

I am trying to think ahead to make it scalable. In a loop to process messages, I want to work with one message at a time and I am using a JavaScript message object. This message object basically describes the message and could contain large amounts of text, byte data as attachments, etc. I also want to be able to process this message object through different filters and operations before saving it off to a database. This script could also possibly be processing large amounts of messages. I want to be sure that I am not going to run into memory problems,

12/1/2009 3:18:14 PM 0 Tony Zakula <tonyzak...@gmail.com>
Narwhal and DLKT

I would like to use the DLKT JavaScript addon as my IDE for developing narwhal apps. I am having trouble getting the environment setup. Narwhal can use rhino as an engine, but I need to setup my "run configuration" to execute my application using narwhals bootstrap process. The normal way of running narwhal is by invoking a shell script in the narwhal/bin directory. I'd appreciate being pointed in the right direction for how to get started on setting up my environment to use Eclipse JavaScript DLKT. Thanks.

12/1/2009 7:02:46 AM 6 Nathan <nrst...@gmail.com>
pid of run rhino js

hi, i run js from shell as below. test.sh java org.mozilla.javascript.tools.shell.Main /path/to/test.js how can i get the pid of it... i use pidof to check it ,but i only can get java pid thanks

11/30/2009 4:42:30 AM 1 "peggy" <peggy...@hotmail.co.jp>
How to call Javascript callback functions form Java

Ok, suppose that I have successfully inserted callback registering Java object into Javascript scope and by using that I can register callback functions using it's register( Object o )-method. When I call something like following in Javascript.... callback.register( function(){ ... } ); // or var f = function(){ ... }; callback.register( f ); // or var tempObj = { f: function(){ ... } }; callback.register( tempObj.f ); ....the register-function in Java gets runtime generated anonymous object as a parameter, which happens to have call-method ( I confirmed it using reflection ).

11/27/2009 4:06:32 PM 3 kunderez <henry.sa...@gmail.com>
how to use java to run javascript by rhino(not j2se 6)

hi, help... how to use java to run javascript by rhino? thanks

11/26/2009 2:49:05 AM 0 "peggy" <peggy...@hotmail.co.jp>
exceptions in java object are not being bobbled

i have exposed few java objects to the context, using ScriptableObject.putProperty(scope, key, Context.javaToJS(obj, scope)); my question: when this object throws an exception (lets say MyException) , i am unable to bobble it properly to the the caller that began the script evaluation. MyException is being wrapped with a null pointer exception. any one knows something about that? thanks

11/23/2009 2:27:55 PM 0 Jaimon <kal.liz...@gmail.com>
from java to run javascript by rhino

hi, help... how can it do java to run many javascript(.js) by rhino ? thanks

11/20/2009 9:28:30 AM 0 "peggy" <peggy...@hotmail.co.jp>
run org.mozilla.javascript.tools.shell

hi, have anyone know why start below is so slowly. java org.mozilla.javascript.tools.shell.Main i want use crontab to excute .sh , then to run .js by rhino. such as : crontab -l ***** /path/to/ex.sh arg1 */2**** /path/to/ex.sh arg2 ex.sh java org.mozilla.javascript.tools.shell.Main ex.js arg1 java org.mozilla.javascript.tools.shell.Main ex.js arg2 ex.js load(ex_{args}.js) everytime to start java org.mozilla.javascript.tools.shell.Main ex.js arg1...etc. , but javascript is fast. any idea to start once time "java org.mozilla.javascript.tool

11/20/2009 1:20:49 AM 0 "peggy" <peggy...@hotmail.co.jp>
Myna Serverside JavaScript Goes Beta

See the bottom of this post for web links. The Myna[1] Javascript Application Server has entered the Beta stage. Myna is an open source Java servlet focused on web development based on the Rhino engine. We are looking for more testers to help make Myna as robust and performant as we can. Here is a short list of features: __Java Servlet__ Myna is a .war file that can be deployed on top of any Java servlet container, so you have a lot of flexibility in deployment platform. The Myna "server" package is just 20MB and includes a lightweight servlet container and startup scripts fo

11/19/2009 10:23:27 PM 0 Mark Porter <dm4m...@gmail.com>
about runCommand to run .sh file

hi, can i use runCommand to run shell file(.sh) . thanks

11/19/2009 8:32:32 AM 0 "peggy" <peggy...@hotmail.co.jp>
Debugging JS in Eclipse

Hi everyone. I spend a lot of my time debugging my project, which is written in a combination of JS (compiled with jsc) and Java. It's great that stack traces include entries that point to the relevant line of the JS file from which the compiled bytecode came, but I would like to use an interactive debugger. Using org.mozilla.javascript.tools.debugger is OK for pure JS issues, but my code bounces around a lot between JS and Java. I'd love to be able to use Eclipse and have a unified stack of JS and Java calls (like you see when you printStackTrace()) and be able to inspec

11/19/2009 2:56:03 AM 3 Cameron McCormack <...@mcc.id.au>
rhino shell run scripts in batch mode

hihi, i use bash shell to call js using rhino. ex: java -jar ../path/to/js.jar ex1.js $* java -jar ../path/to/js.jar ex2.js $* java -jar ../path/to/js.jar ex3.js $* ex1,ex2,ex3 are different javacript project and excute easy script( like as only print for test). must it write many times [java -jar .../path/to/js.jar ] ? it is very slowly to start java to excute ex1(2,3).js everytime. coz it will let %cpu high to start java everytime. thanks. peggy.

11/19/2009 2:49:09 AM 5 "peggy" <peggy...@hotmail.co.jp>
ReferenceError while running from java

Hi, I am running a proxy pac file from java 1.6 and it results in the following exception. Do you have any idea how can I make the isPlainHostName get resolved? javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "isPlainHostName" is not defined. (<Unknown source>#5) in <Unknown source> at line number 5 at com.sun.script.javascript.RhinoScriptEngine.invoke(RhinoScriptEngine.java:184) at com.sun.script.javascript.RhinoScriptEngine.invokeFunction(RhinoScriptEngine.java:142) at Test.main(Test.java:30) Thanks, Giri.

11/17/2009 4:28:24 AM 0 Giri KM <gir...@gmail.com>
Latest Rhino on Mac PPC?

My project, JsDoc Toolkit, is built on top of Rhino and I'm very keen to start using the new AST functionality that is in the CVS repository. However I've found that I cannot compile the latest version of Rhino from CVS on my development machine: a Mac running PPC (not Intel). Does Rhino require Java6? If so then I'm shut out as Java6 requires an Intel chip on Mac.

11/16/2009 9:31:43 AM 3 Michael <micm...@gmail.com>
how get debug information from the debug frame

hi, i have followed the very good example of David Parks regarding to how to implement and embed the rhino debugger. i have few questions regarding it: 1) once i am the public void onDebuggerStatement(Context cx) function is being called and i have the context. how can i retrieve the debug information from the context? how can i get all the variables list and their values? 2) what is the use of the contextData that the setDebugger is getting as a parameter? all the examples that i have seen didn't really use it. thanks a lot me

11/9/2009 2:41:56 PM 0 Jaimon <kal.liz...@gmail.com>
how get debug information from the debug frame

hi, i have followed the very good example of David Parks regarding to how to implement and embed the rhino debugger. i have few questions regarding it: 1) once i am the public void onDebuggerStatement(Context cx) function is being called and i have the context. how can i retrieve the debug information from the context? how can i get all the variables list and their values? 2) what is the use of the contextData that the setDebugger is getting as a parameter? all the examples that i have seen didn't really use it. thanks a lot me

11/9/2009 1:51:39 PM 1 Jaimon <kal.liz...@gmail.com>
Catch and re-throw in javascript without loosing stack info

Hi list, I've got my application running great with Rhino. I'm at the point now where I want to clean up my exception handling. If I let my script exceptions percolate up to Java, I get correct stack information about where the exception occurred. However, in cases where I want to catch the exception in script, conditionally process it, and maybe re-throw, I don't see how to get the original exception back. I'm hoping there's an API call that I just missed. Here's an example doesThrow = function(){ //stupid, but illustrates the point throw Math.random(); } doesReth

11/8/2009 7:18:58 PM 2 wolffiex <awo...@gmail.com>
Error handling - Help required !!

Hi Support ! I am using rhino. How i can do error handing using rhino ? Question example - I had some method which is having some n number of input params, if one required param is undefine then i want to throw an error. For this I made a JS scriptable error object. so how i can set this error object by using rhino error object ( if it does have) ? please explain in detail. I would be very thankful to you. Thanks. Rajat

11/7/2009 4:41:30 PM 8 Rajat Gupta <innocent_pers...@yahoo.com>
rhino books

Iv'e been looking the net for rhino books, but almost all the information is about rhino 3 d (nto quite what i was looking for). any tips for rhino book search? does any book about rhino actually exist? or perhaps a java book with a chapter about rhino?

11/7/2009 2:30:44 PM 0 fel <felipeval...@gmail.com>
rhino cheatsheet

why don't we have a rhino cheatsheet? would that help bring people into rhino, raise interest in the technology? what do you guys think?

11/6/2009 8:19:07 PM 0 fel <felipeval...@gmail.com>
Statistics of using non-shared scopes

People are often asking on the Rhino list about using shared top-level scopes for standard objects in server setting for increased speed and possible memory conservation. I'm now redesigning a system that originally used shared scopes, and am experimenting with not using them. The reason for it is that the possibility for crosstalk between otherwise isolated script executions is there, and it also tempts one to use dynamic scopes (which, again, I frown upon especially if I also wish to leverage lexical scoping for OO encapsulation and don't need any nasty surprises ther

11/5/2009 12:38:36 PM 0 Attila Szegedi <szege...@gmail.com>
Potential speedup in object property access

Inspired by Norris' recent remark about low hanging fruit in the Rhino garden I've started to experiment with mapping individual JS Objects directly to Java classes with property access implemented by auto- generated bytecode. I've created a project on github with some initial proof-of-concept code: http://github.com/hns/rhino-8 I called it rhino-8 because I started out on the idea of native JS property access implemented by Google's V8 engine described here: http://code.google.com/apis/v8/design.html#prop_access Obviously, the JVM poses some restrictions on what you can do (f

11/3/2009 9:48:32 AM 3 Hannes Wallnoefer <hann...@gmail.com>
Executing google ads script

Hello, I am using Cobra (lobobroswer based parser) for HTML parsing and rhino for javascript parsing of web pages. However, the google ads script is not executing. I want to retrieve the source code of the page including the script generated ads. Please help. Also, is there a way of executing the following script explicitly and returning the result as a string: &lt;script type="text/javascript"> google_ad_client = "pub-"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text_image"; google_color_border = "FFFFFF"; google_color_bg

11/2/2009 11:17:28 AM 0 Shuchi <shuchishu...@gmail.com>
a very weird problem from Rhino js shell

HI When I use Rhino JS shell to execute the following code, Main m = new Main(); // rhino js shell main function String argsServer[] = {"interpreterRun.js", "addTags_coordinatorScript.js"}; m.main(argsServer); *// 1* System.out.println("----------------------------------"); Main m2 = new Main(); String argsServer2[] = {"interpreterRun.js", "addTags_coordinatorScript.js"}; m.main(argsServer); *// 2* the execution result for 1 is totally correct s_checkTagsWF s_checkIsExistingWF s_storeTagsDBWF ---------------------

10/25/2009 8:14:53 AM 0 Peng Li <lipeng...@gmail.com>
Calling Java CLI programs through Rhino

Hey, I've heard a number of things about this project before but only recently dipped my toe in. So far I'm really pleased by what I'm finding -- keep up the good work! One question I had, though, was whether it is possible to blend Java CLI programs with Rhino's shell. I would very much like to combine the scripting power provided by the shell with the functionality present in programs I've written. In this case, I am thinking a little of Microsoft's Powershell as a model. As far as I can tell I am not able to simply invoke a program and pass arguments. Is that correct? How could I go

10/25/2009 5:51:16 AM 3 aschearer <aschea...@gmail.com>
Identity of the project

Folks, I was looking at few things today in Bugzilla, one of them is <https://bugzilla.mozilla.org/show_bug.cgi?id=519933 >. The gist of it is that Rhino CVS HEAD code now conforms to TC39 ES3.1 Draft of 9-Feb-2009, 8.12.4, step 2 and will throw a TypeError when assigning to a property that has a getter but has no setter. However, this was not really prohibited by earlier versions of either ECMAScript or JavaScript. Rhino itself doesn't only support ECMAScript 5, it actually supports a whole range of JavaScript versions (and, FWIW, ECMAScript 5 will only be used in Jav

10/23/2009 12:19:43 PM 6 Attila Szegedi <szege...@gmail.com>
how to execute the dos program

hi all as title I use the Standard Widget Toolkit to GUI and Rhino to program But I don't know, how to call the "notepad.exe" or other *.exe file when I press the open button Any idea? -- best regards Hidding

10/23/2009 12:04:44 PM 0 Hidding <mindlovem...@gmail.com>
Script functions to script object

Hi all, I have a question about dynamically create javascript objects: I have a jscript stream I *can't change, *like this: var msg = "hello"; function printMsg(){ alert(msg); } And I would like declare an object (ex. "printer") to execute scripts like "printer.printMsg()". I've try many things like: Script scriptObjectPrinter = (Script)context.compileString([STREAM],"printer",1,null); Object o = scriptObjectPrinter.exec(context, newScope); scope.put("printer", scope, o); //Another option //ScriptableObject.putProperty(scriptObjectPrinter, "printer", scrip

10/22/2009 8:55:26 PM 3 Alex Fernandez Nogueira <alex...@gmail.com>
Native Decimal support in Rhino

Hi, I've started working on the support of native exact Decimal numbers in Rhino, following the proposition that was formulated by Sam Ruby (with some feedback from Brendand Eich as I understand it): http://intertwingly.net/blog/2008/07/11/Decimal-in-ECMAScript https://bugzilla.mozilla.org/show_bug.cgi?id=445178 I'm mostly done with the implementation in the interpreter, I still need to beef up a bit the test cases to cover more corner cases but overall it seems to work fine. The compiler is another beast (isn't it always?) and I'm confronted with a hard choice so I thought I wo

10/22/2009 6:39:32 PM 1 Matthieu Riou <matth...@offthelip.org>
Java Primitive Wrapped Object to Javascrip Primitive

Hi, I am new to Rhino. I am utilizing the javax.scripting with Rhino in this project. I have a Java method that returns a Java Object (Double, Long, Integer, etc). I want to call that method from javascript and reference the result as a Javascript primitive type. However, javacript recognizes the return type as an Object. How do I force it to convert to a javascript primitive? This question is very similar to http://groups.google.com/group/mozilla.dev.tech.js-engine.rhino/browse_thread/thread/2f3d43bb49d5288a/dde79e1aa72e1301 The problem with that is how do I get a referenc

10/16/2009 6:33:24 PM 0 Johnia <john...@gmail.com>
Instrumenting Javascript using Rhino

Hi, I would like to use Rhino (if possible) to instrument some Javascript code. This means I would need to use the Rhino parser to create an AST, then modify this AST and somehow print out Javascript source code again. Is this possible? Where can I find the documentation I would need? Regards, Frank Groeneveld

10/16/2009 12:14:47 PM 0 Frank <frankgroenev...@gmail.com>
Globbing arguments with runCommand

How can I get the arguments to a command called with runCommand to perform wildcard expansion? For example, if I call runCommand("ls", "*/*/Test.*"), runCommand calls "ls */*/Test.*" instead of correctly calling ls with the arguments after doing wildcard expansion. Is there a way to get this behavior using runCommand?

10/15/2009 6:00:57 PM 2 Chandler Kent <ckents...@gmail.com>
Embedding Rhino in an Android app

Hi, all, hoping someone can give me a few pointers as to what I'm doing wrong. I'm trying to embed Rhino in my Android app to add scripting functionality. According to Google, the Rhino shell works fine on Android, which I've confirmed by building and running it from source under Donut. So unless I'm comparing apples and orangutangs, my use case should work too. First I tried the basic embedding examples from the documentation, though I called cx.setOptimization(-1) to disable all compilation. No luck. I then thought that perhaps something was being optimized in the conte

10/15/2009 1:10:33 AM 2 "Nolan Darilek" <no...@thewordnerd.info>
Rhino 1.7R3/1.8

Hi there, After trying to find out when will be the next Rhino release I have no other option but to ask directly. Actually I am pretty interested in the new AST api which I see is already in the cvs (head). For now I have a quite dirty piece of code to more or less extract the AST from the existing Node class (in <=1.7R2) and it's getting pretty troublesome with destructuring assignments and a few other constructions. I just use that to shrink/obfuscate chunks of javascript (reducing code size) and it works well up to js 1.6 syntax but I am pretty interested to find a better w

10/11/2009 3:22:39 AM 1 nitro tm <nitro....@gmail.com>

Pages: 2











Newest Articles

[Hendrix] generic valtrex xjs
18 min. 19 sec. ago

[Hendrix] не открывает страницы
37 min. 35 sec. ago

[Hendrix] Add Ons
43 min. 40 sec. ago

[Hendrix] Feedback on Firefox.Exe
50 min. 19 sec. ago

Empty trash and compact folders in ver 3.6
58 min. 59 sec. ago