public void EvaluateNewWithObjectFunction()
{
this.EvaluateCommands("var obj = new Object(); obj.foo = function() { this.name = 'Adam'; this.age = 800; };");
object result = this.EvaluateExpression("new obj.foo()");
Assert.IsInstanceOfType(result, typeof(IObject));
IObject obj = (IObject)result;
Assert.AreEqual("Adam", obj.GetValue("name"));
Assert.AreEqual(800, obj.GetValue("age"));
}