internal ClrFunction(ObjectInstance prototype, Delegate delegateToCall, string name = null, int length = -1)
: base(prototype)
{
// Initialize the [[Call]] method.
this.callBinder = new JSBinder(new JSBinderMethod(delegateToCall.Method));
// If the delegate has a class instance, use that to call the method.
this.thisBinding = delegateToCall.Target;
// Add function properties.
this.FastSetProperty("name", name != null ? name : this.callBinder.Name, PropertyAttributes.Configurable);
this.FastSetProperty("length", length >= 0 ? length : this.callBinder.FunctionLength, PropertyAttributes.Configurable);
//this.FastSetProperty("prototype", this.Engine.Object.Construct());
//this.InstancePrototype.FastSetProperty("constructor", this, PropertyAttributes.NonEnumerable);
}