@@ -289,7 +289,7 @@ private enum TryBlockEvaluatedState
289289 { ExpressionOperator . Greater , ( dynamic left , dynamic right ) => left > right } ,
290290 { ExpressionOperator . LowerOrEqual , ( dynamic left , dynamic right ) => left <= right } ,
291291 { ExpressionOperator . GreaterOrEqual , ( dynamic left , dynamic right ) => left >= right } ,
292- { ExpressionOperator . Is , ( dynamic left , dynamic right ) => left != null && ( ( ( ClassOrTypeName ) right ) . Type ) . IsAssignableFrom ( left . GetType ( ) ) } ,
292+ { ExpressionOperator . Is , ( dynamic left , dynamic right ) => left != null && ( ( ( ClassOrEnumType ) right ) . Type ) . IsAssignableFrom ( left . GetType ( ) ) } ,
293293 } ,
294294 new Dictionary < ExpressionOperator , Func < dynamic , dynamic , object > > ( )
295295 {
@@ -376,7 +376,7 @@ private enum TryBlockEvaluatedState
376376 {
377377 object argValue = self . Evaluate ( args [ 0 ] ) ;
378378
379- if ( argValue is ClassOrTypeName classOrTypeName )
379+ if ( argValue is ClassOrEnumType classOrTypeName )
380380 return Activator . CreateInstance ( classOrTypeName . Type ) ;
381381 else
382382 return null ;
@@ -406,7 +406,7 @@ private enum TryBlockEvaluatedState
406406 { "new" , ( self , args ) =>
407407 {
408408 List < object > cArgs = args . ConvertAll ( arg => self . Evaluate ( arg ) ) ;
409- return Activator . CreateInstance ( ( cArgs [ 0 ] as ClassOrTypeName ) . Type , cArgs . Skip ( 1 ) . ToArray ( ) ) ;
409+ return Activator . CreateInstance ( ( cArgs [ 0 ] as ClassOrEnumType ) . Type , cArgs . Skip ( 1 ) . ToArray ( ) ) ;
410410 }
411411 } ,
412412 { "Round" , ( self , args ) =>
@@ -434,7 +434,7 @@ private enum TryBlockEvaluatedState
434434 { "Sign" , ( self , args ) => Math . Sign ( Convert . ToDouble ( self . Evaluate ( args [ 0 ] ) ) ) } ,
435435 { "sizeof" , ( self , args ) =>
436436 {
437- Type type = ( ( ClassOrTypeName ) self . Evaluate ( args [ 0 ] ) ) . Type ;
437+ Type type = ( ( ClassOrEnumType ) self . Evaluate ( args [ 0 ] ) ) . Type ;
438438
439439 if ( type == typeof ( bool ) )
440440 return 1 ;
@@ -444,7 +444,7 @@ private enum TryBlockEvaluatedState
444444 return Marshal . SizeOf ( type ) ;
445445 }
446446 } ,
447- { "typeof" , ( self , args ) => ( ( ClassOrTypeName ) self . Evaluate ( args [ 0 ] ) ) . Type } ,
447+ { "typeof" , ( self , args ) => ( ( ClassOrEnumType ) self . Evaluate ( args [ 0 ] ) ) . Type } ,
448448 } ;
449449
450450 #endregion
@@ -1065,7 +1065,7 @@ void ExecuteTryList()
10651065
10661066 if ( exceptionVariable . Length >= 2 )
10671067 {
1068- if ( ! ( ( ClassOrTypeName ) Evaluate ( exceptionVariable [ 0 ] ) ) . Type . IsAssignableFrom ( exception . GetType ( ) ) )
1068+ if ( ! ( ( ClassOrEnumType ) Evaluate ( exceptionVariable [ 0 ] ) ) . Type . IsAssignableFrom ( exception . GetType ( ) ) )
10691069 continue ;
10701070
10711071 exceptionName = exceptionVariable [ 1 ] ;
@@ -1770,7 +1770,7 @@ private bool EvaluateVarOrFunc(string expr, string restOfExpression, Stack<objec
17701770 throw new ExpressionEvaluatorSecurityException ( $ "{ obj . GetType ( ) . FullName } type is blocked") ;
17711771 else if ( obj is Type staticType && TypesToBlock . Contains ( staticType ) )
17721772 throw new ExpressionEvaluatorSecurityException ( $ "{ staticType . FullName } type is blocked") ;
1773- else if ( obj is ClassOrTypeName classOrType && TypesToBlock . Contains ( classOrType . Type ) )
1773+ else if ( obj is ClassOrEnumType classOrType && TypesToBlock . Contains ( classOrType . Type ) )
17741774 throw new ExpressionEvaluatorSecurityException ( $ "{ classOrType . Type } type is blocked") ;
17751775
17761776 try
@@ -1937,7 +1937,7 @@ private bool EvaluateVarOrFunc(string expr, string restOfExpression, Stack<objec
19371937 throw new ExpressionEvaluatorSecurityException ( $ "{ obj . GetType ( ) . FullName } type is blocked") ;
19381938 else if ( obj is Type staticType && TypesToBlock . Contains ( staticType ) )
19391939 throw new ExpressionEvaluatorSecurityException ( $ "{ staticType . FullName } type is blocked") ;
1940- else if ( obj is ClassOrTypeName classOrType && TypesToBlock . Contains ( classOrType . Type ) )
1940+ else if ( obj is ClassOrEnumType classOrType && TypesToBlock . Contains ( classOrType . Type ) )
19411941 throw new ExpressionEvaluatorSecurityException ( $ "{ classOrType . Type } type is blocked") ;
19421942
19431943 try
@@ -2224,7 +2224,7 @@ private bool EvaluateVarOrFunc(string expr, string restOfExpression, Stack<objec
22242224
22252225 if ( staticType != null )
22262226 {
2227- stack . Push ( new ClassOrTypeName ( ) { Type = staticType } ) ;
2227+ stack . Push ( new ClassOrEnumType ( ) { Type = staticType } ) ;
22282228 }
22292229 else
22302230 {
@@ -2894,7 +2894,7 @@ private BindingFlags DetermineInstanceOrStatic(ref Type objType, ref object obj,
28942894 obj = valueTypeNestingTrace . Value ;
28952895 }
28962896
2897- if ( obj is ClassOrTypeName classOrTypeName )
2897+ if ( obj is ClassOrEnumType classOrTypeName )
28982898 {
28992899 objType = classOrTypeName . Type ;
29002900 obj = null ;
@@ -3369,7 +3369,7 @@ public enum OptionOnNoReturnKeywordFoundInScriptAction
33693369
33703370 #region ExpressionEvaluator linked public classes (specific Exceptions and EventArgs)
33713371
3372- public partial class ClassOrTypeName
3372+ public partial class ClassOrEnumType
33733373 {
33743374 public Type Type { get ; set ; }
33753375 }
0 commit comments