Rhino.ScriptRuntime.PadArguments C# (CSharp) Method

PadArguments() public static method

Helper function for builtin objects that use the varargs form.
Helper function for builtin objects that use the varargs form. ECMA function formal arguments are undefined if not supplied; this function pads the argument array out to the expected length, if necessary.
public static PadArguments ( object args, int count ) : object[]
args object
count int
return object[]
		public static object[] PadArguments(object[] args, int count)
		{
			if (count < args.Length)
			{
				return args;
			}
			int i;
			object[] result = new object[count];
			for (i = 0; i < args.Length; i++)
			{
				result[i] = args[i];
			}
			for (; i < count; i++)
			{
				result[i] = Undefined.instance;
			}
			return result;
		}
ScriptRuntime