public override void CastClass(Type type)
{
if (type == null)
throw new ArgumentNullException("type");
//if (this.EnableDiagnostics == true && ScriptEngine.LowPrivilegeEnvironment == false)
//{
// // Provides more information if a cast fails.
// var endOfCheckLabel = this.CreateLabel();
// this.Duplicate();
// this.IsInstance(type);
// this.BranchIfNotNull(endOfCheckLabel);
// this.LoadToken(type);
// this.Call(ReflectionHelpers.Type_GetTypeFromHandle);
// this.LoadString(Environment.StackTrace);
// this.Call(typeof(DynamicILGenerator).GetMethod("OnFailedCast", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic));
// this.Throw();
// this.DefineLabelPosition(endOfCheckLabel);
//}
int token = this.GetToken(type);
Emit1ByteOpCodeInt32(0x74, 1, 1, token);
PopStackOperands(VESType.Object);
PushStackOperand(VESType.Object);
}