please accept this patch for above problem

--- OrigJavaScriptEngine.java   2004-06-15 08:25:06.000000000 +0600
+++ JavaScriptEngine.java       2004-06-18 14:56:57.000000000 +0600
@@ -142,16 +142,23 @@
     }

     public void declareBean(BSFDeclaredBean bean) throws BSFException {
-        if ((bean.bean instanceof Number) ||
-            (bean.bean instanceof String) ||
-            (bean.bean instanceof Boolean)) {
-            global.put(bean.name, global, bean.bean);
-        }
-        else {
-            // Must wrap non-scriptable objects before presenting to Rhino
-            Scriptable wrapped = Context.toObject(bean.bean, global);
-            global.put(bean.name, global, wrapped);
-        }
+       Context cx;
+       try{
+               if ((bean.bean instanceof Number) ||
+                   (bean.bean instanceof String) ||
+                   (bean.bean instanceof Boolean)) {
+                   global.put(bean.name, global, bean.bean);
+               }
+               else {
+                   // Must wrap non-scriptable objects before presenting to Rhino
+                   Scriptable wrapped = Context.toObject(bean.bean, global);
+                   global.put(bean.name, global, wrapped);
+               }
+       }finally
+       {
+               Context.exit();
+       }
+
     }

     /**

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to