Subj : Rhino instanceof problem/question. To : netscape.public.mozilla.jseng From : ob7ect@hotmail.com (ob7ect) Date : Sat Jan 17 2004 01:41 pm I've been using Rhino in an application that I've been developing for a couple of years, and have never encountered this problem before. I'm wondering if it's just something trivial that I've missed, but perhaps someone can help illuminate the problem. In Java, I'm calling a JS function: Object[] fArgs = new Object[]{ activator, target, cmdstring, sd, new Integer(2) }; boolean result = Context.toBoolean( ScriptEngine.callFunction(sd.getFunctionName(), fArgs ) ); In JS, the function I'm calling is like this: function myfunction(activator,target,cstr,sd,state){ if ( target instanceof my.framework.BaseObject ){ // is a BaseObject // never evaluates true, although it should }else{ echo("class: " + target.getClass().getName()); // echos: class: my.framework.BaseObject } if ( target.getParent() instanceof my.framework.BaseObject ){ // is a BaseObject // evaluates true } } Now I know that the object being passed in through the 'target' parameter is ALWAYS a subclass of BaseObject (as is reported by getClass().getName()), and that it's parent (getParent()) is also always a BaseObject. Now for some reason the first call, which tests the function arg 'target' doesn't type to any class -- not even Object, while the second does seem to work. Does Rhino do something special to function argument parameters that prevents instanceof from operating on them properly?? Thanks for any help, -mark .