@@ -968,7 +968,7 @@ private object InvokeDynamicMember(string name, BindingFlags invokeFlags, object
968968 {
969969 if ( name == SpecialMemberNames . Default )
970970 {
971- return TargetDynamic . Invoke ( args , true ) ;
971+ return TargetDynamic . Invoke ( true , args ) ;
972972 }
973973
974974 throw new InvalidOperationException ( "Invalid constructor invocation" ) ;
@@ -980,7 +980,7 @@ private object InvokeDynamicMember(string name, BindingFlags invokeFlags, object
980980 {
981981 try
982982 {
983- return TargetDynamic . Invoke ( args , false ) ;
983+ return TargetDynamic . Invoke ( false , args ) ;
984984 }
985985 catch ( Exception )
986986 {
@@ -1302,7 +1302,7 @@ private object InvokeHostMember(string name, BindingFlags invokeFlags, object[]
13021302 var enumerableHelpersHostItem = Wrap ( engine , EnumerableHelpers . HostType , HostItemFlags . PrivateAccess ) ;
13031303 try
13041304 {
1305- return ( ( IDynamic ) enumerableHelpersHostItem ) . InvokeMethod ( "GetEnumerator" , new object [ ] { this } ) ;
1305+ return ( ( IDynamic ) enumerableHelpersHostItem ) . InvokeMethod ( "GetEnumerator" , this ) ;
13061306 }
13071307 catch ( MissingMemberException )
13081308 {
@@ -1542,7 +1542,7 @@ private object GetHostProperty(PropertyInfo property, BindingFlags invokeFlags,
15421542 }
15431543
15441544 var getMethod = property . GetMethod ;
1545- if ( ( getMethod == null ) || ! getMethod . IsAccessible ( accessContext ) || getMethod . IsBlockedFromScript ( defaultAccess ) )
1545+ if ( ( getMethod == null ) || ! getMethod . IsAccessible ( accessContext ) || getMethod . IsBlockedFromScript ( defaultAccess , false ) )
15461546 {
15471547 throw new UnauthorizedAccessException ( "Property get method is unavailable or inaccessible" ) ;
15481548 }
@@ -1655,7 +1655,7 @@ private object SetHostProperty(PropertyInfo property, BindingFlags invokeFlags,
16551655 }
16561656
16571657 var setMethod = property . SetMethod ;
1658- if ( ( setMethod == null ) || ! setMethod . IsAccessible ( accessContext ) || setMethod . IsBlockedFromScript ( defaultAccess ) )
1658+ if ( ( setMethod == null ) || ! setMethod . IsAccessible ( accessContext ) || setMethod . IsBlockedFromScript ( defaultAccess , false ) )
16591659 {
16601660 throw new UnauthorizedAccessException ( "Property set method is unavailable or inaccessible" ) ;
16611661 }
@@ -1697,7 +1697,7 @@ public override string ToString()
16971697
16981698 public override bool TryCreateInstance ( CreateInstanceBinder binder , object [ ] args , out object result )
16991699 {
1700- result = ThisDynamic . Invoke ( args , true ) . ToDynamicResult ( engine ) ;
1700+ result = ThisDynamic . Invoke ( true , args ) . ToDynamicResult ( engine ) ;
17011701 return true ;
17021702 }
17031703
@@ -1709,7 +1709,7 @@ public override bool TryGetMember(GetMemberBinder binder, out object result)
17091709
17101710 public override bool TrySetMember ( SetMemberBinder binder , object value )
17111711 {
1712- ThisDynamic . SetProperty ( binder . Name , new [ ] { value } ) ;
1712+ ThisDynamic . SetProperty ( binder . Name , value ) ;
17131713 return true ;
17141714 }
17151715
@@ -1730,7 +1730,7 @@ public override bool TryGetIndex(GetIndexBinder binder, object[] indices, out ob
17301730
17311731 if ( indices . Length > 1 )
17321732 {
1733- result = ThisDynamic . GetProperty ( SpecialMemberNames . Default , indices ) ;
1733+ result = ThisDynamic . GetProperty ( SpecialMemberNames . Default , indices ) . ToDynamicResult ( engine ) ;
17341734 return true ;
17351735 }
17361736
@@ -1748,7 +1748,7 @@ public override bool TrySetIndex(SetIndexBinder binder, object[] indices, object
17481748 return true ;
17491749 }
17501750
1751- ThisDynamic . SetProperty ( indices [ 0 ] . ToString ( ) , new [ ] { value } ) ;
1751+ ThisDynamic . SetProperty ( indices [ 0 ] . ToString ( ) , value ) ;
17521752 return true ;
17531753 }
17541754
@@ -1762,7 +1762,7 @@ public override bool TrySetIndex(SetIndexBinder binder, object[] indices, object
17621762
17631763 public override bool TryInvoke ( InvokeBinder binder , object [ ] args , out object result )
17641764 {
1765- result = ThisDynamic . Invoke ( args , false ) . ToDynamicResult ( engine ) ;
1765+ result = ThisDynamic . Invoke ( false , args ) . ToDynamicResult ( engine ) ;
17661766 return true ;
17671767 }
17681768
@@ -1930,12 +1930,12 @@ Type IReflect.UnderlyingSystemType
19301930
19311931 #region IDynamic implementation
19321932
1933- object IDynamic . GetProperty ( string name , object [ ] args )
1933+ object IDynamic . GetProperty ( string name , params object [ ] args )
19341934 {
19351935 return InvokeReflectMember ( name , BindingFlags . GetProperty , args , CultureInfo . InvariantCulture , null ) ;
19361936 }
19371937
1938- object IDynamic . GetProperty ( string name , object [ ] args , out bool isCacheable )
1938+ object IDynamic . GetProperty ( string name , out bool isCacheable , params object [ ] args )
19391939 {
19401940 return InvokeReflectMember ( name , BindingFlags . GetProperty , args , CultureInfo . InvariantCulture , null , out isCacheable ) ;
19411941 }
@@ -2011,7 +2011,7 @@ object IDynamic.GetProperty(int index)
20112011
20122012 void IDynamic . SetProperty ( int index , object value )
20132013 {
2014- ThisDynamic . SetProperty ( index . ToString ( CultureInfo . InvariantCulture ) , new [ ] { value } ) ;
2014+ ThisDynamic . SetProperty ( index . ToString ( CultureInfo . InvariantCulture ) , value ) ;
20152015 }
20162016
20172017 bool IDynamic . DeleteProperty ( int index )
@@ -2064,12 +2064,12 @@ int[] IDynamic.GetPropertyIndices()
20642064 } ) ;
20652065 }
20662066
2067- object IDynamic . Invoke ( object [ ] args , bool asConstructor )
2067+ object IDynamic . Invoke ( bool asConstructor , params object [ ] args )
20682068 {
20692069 return ThisReflect . InvokeMember ( SpecialMemberNames . Default , asConstructor ? BindingFlags . CreateInstance : ( ( args . Length < 1 ) ? BindingFlags . InvokeMethod : BindingFlags . InvokeMethod | BindingFlags . GetProperty ) , null , ThisReflect , args , null , CultureInfo . InvariantCulture , null ) ;
20702070 }
20712071
2072- object IDynamic . InvokeMethod ( string name , object [ ] args )
2072+ object IDynamic . InvokeMethod ( string name , params object [ ] args )
20732073 {
20742074 return ThisReflect . InvokeMember ( name , BindingFlags . InvokeMethod , null , ThisReflect , args , null , CultureInfo . InvariantCulture , null ) ;
20752075 }
0 commit comments