Object wrappedThis = Context.javaToJS( this, scope );
ScriptableObject.putProperty( scope, "out", wrappedOut ); //$NON-NLS-1$
ScriptableObject.putProperty( scope, "rule", wrappedThis ); //$NON-NLS-1$
// evaluate the script
Object resultObject = cx.evaluateString( scope, script, "<cmd>", 1, null ); //$NON-NLS-1$
Object actualObject = null;
if ( resultObject instanceof org.mozilla.javascript.NativeJavaObject ) {
actualObject = ( (org.mozilla.javascript.NativeJavaObject) resultObject ).unwrap();
} else {