Subj : problem creating class level functions in rhino To : netscape.public.mozilla.jseng From : jtb Date : Mon Apr 11 2005 07:36 pm Hello everyone, I'm doing some new code and trying rhino. I want to build up a class object by evaluating strings but it doesnt seem to work the way I expect. here is the relavent code, that doesnt seem to work. it's pretty straightforward... ----------------------------------------------------------------- Context context = Context.enter(); Scriptable scope = context.initStandardObjects(); evaluateString("function CLASS() {}"); evaluateString("CLASS.x = 5"); // // everything up to here is fine, but the next line fails: // evaluateString("CLASS.blah = function() {}"); ----------------------------------------------------------------- (for clarity evaluateString() is defined as: ----------------------------------------------------------------- public void evaluateString(String code) { context.evaluateString(scope, code, "", 1, null); } ----------------------------------------------------------------- the first block fails with the following exception at the last line... Exception in thread "main" java.lang.VerifyError: (class: org/mozilla/javascript/gen/c3, method: _c0 signature: (Lorg/mozilla/javascript/gen/c3;Lorg/mozilla/javascript/Context; Lorg/mozilla/javascript/Scriptable;Lorg/mozilla/javascript/Scriptable; [Ljava/lang/Object;)Ljava/lang/Object;) Incompatible argument anyone willing to hand me a small clue, would be greatly appreciated... jb .