Jurassic.Compiler.DynamicILGenerator.NewObject C# (CSharp) Method

NewObject() public method

Pops the constructor arguments off the stack and creates a new instance of the object.
public NewObject ( System constructor ) : void
constructor System The constructor that is used to initialize the object.
return void
        public override void NewObject(System.Reflection.ConstructorInfo constructor)
        {
            if (constructor == null)
                throw new ArgumentNullException("constructor");

            // Get the argument details.
            var parameters = constructor.GetParameters();

            var token = this.GetToken(constructor);
            Emit1ByteOpCodeInt32(0x73, parameters.Length, 1, token);

#if DEBUG
            // Check the stack.
            var operandTypes = new List<VESType>(parameters.Length);
            foreach (var parameter in parameters)
                operandTypes.Add(ToVESType(parameter.ParameterType));
            PopStackOperands(operandTypes.ToArray());
            PushStackOperand(ToVESType(constructor.DeclaringType));
#endif
        }
DynamicILGenerator