public JsInstance Eval(JsInstance[] arguments)
{
if (JsInstance.CLASS_STRING != arguments[0].Class) {
return arguments[0];
}
Program p;
try {
p = JintEngine.Compile(arguments[0].ToString(), Visitor.DebugMode);
}
catch (Exception e) {
throw new JsException(this.SyntaxErrorClass.New(e.Message));
}
try {
p.Accept((IStatementVisitor)Visitor);
}
catch (Exception e) {
throw new JsException(this.EvalErrorClass.New(e.Message));
}
return Visitor.Result;
}