public static object New(this IExpando scope, string functionName, params object[] args) { var constructor = (IExpando)scope.GetValue(functionName); var proto = constructor.GetValue("prototype"); var obj = (IExpando)scope.GetValue("Object"); var instance = (IExpando)obj.Invoke("create", new object[] { proto }); Call(constructor, instance, args); return(instance); }