Rhino.FunctionObject.CreateObject C# (CSharp) Method

CreateObject() public method

Return new Scriptable instance using the default constructor for the class of the underlying Java method. Return null to indicate that the call method should be used to create new objects.
public CreateObject ( Context cx, Scriptable scope ) : Scriptable
cx Context
scope Scriptable
return Scriptable
		public override Scriptable CreateObject(Context cx, Scriptable scope)
		{
			if (member.IsCtor() || parmsLength == VARARGS_CTOR)
			{
				return null;
			}
			Scriptable result;
			try
			{
				result = (Scriptable)System.Activator.CreateInstance(member.GetDeclaringClass());
			}
			catch (Exception ex)
			{
				throw Context.ThrowAsScriptRuntimeEx(ex);
			}
			result.SetPrototype(GetClassPrototype());
			result.SetParentScope(GetParentScope());
			return result;
		}