added new invocation that does not create a call frame
[org.ibex.js.git] / src / org / ibex / js / JS.java
index 3a11127..7cd1fc7 100644 (file)
@@ -187,6 +187,11 @@ public class JS /*extends org.ibex.util.BalancedTree*/ implements Serializable {
         return ((JSFunction)j)._cloneWithNewParentScope(s);
     }
 
+    public static Object eval(JS j) throws JSExn {
+        Interpreter cx = new Interpreter((JSFunction)j, false, new JSArray(), false);
+        return cx.resume();
+    }
+
 
     // Trap support //////////////////////////////////////////////////////////////////////////////