Remove dead code about 'IsTransparentProxy' (#9966)
This commit is contained in:
parent
482c64b35f
commit
9dfec6ca84
3 changed files with 42 additions and 63 deletions
|
@ -4370,49 +4370,49 @@ namespace System.Management.Automation.Language
|
|||
switch (token.Kind)
|
||||
{
|
||||
#if SUPPORT_PUBLIC_PRIVATE
|
||||
case TokenKind.Public:
|
||||
if (publicToken != null)
|
||||
{
|
||||
ReportError(token.Extent,
|
||||
nameof(ParserStrings.DuplicateQualifier),
|
||||
ParserStrings.DuplicateQualifier,
|
||||
token.Text);
|
||||
}
|
||||
case TokenKind.Public:
|
||||
if (publicToken != null)
|
||||
{
|
||||
ReportError(token.Extent,
|
||||
nameof(ParserStrings.DuplicateQualifier),
|
||||
ParserStrings.DuplicateQualifier,
|
||||
token.Text);
|
||||
}
|
||||
|
||||
if (privateToken != null)
|
||||
{
|
||||
ReportError(token.Extent,
|
||||
nameof(ParserStrings.ModifiersCannotBeCombined),
|
||||
ParserStrings.ModifiersCannotBeCombined,
|
||||
privateToken.Text,
|
||||
token.Text);
|
||||
}
|
||||
if (privateToken != null)
|
||||
{
|
||||
ReportError(token.Extent,
|
||||
nameof(ParserStrings.ModifiersCannotBeCombined),
|
||||
ParserStrings.ModifiersCannotBeCombined,
|
||||
privateToken.Text,
|
||||
token.Text);
|
||||
}
|
||||
|
||||
publicToken = token;
|
||||
SkipToken();
|
||||
break;
|
||||
publicToken = token;
|
||||
SkipToken();
|
||||
break;
|
||||
|
||||
case TokenKind.Private:
|
||||
if (privateToken != null)
|
||||
{
|
||||
ReportError(token.Extent,
|
||||
nameof(ParserStrings.DuplicateQualifier),
|
||||
ParserStrings.DuplicateQualifier,
|
||||
token.Text);
|
||||
}
|
||||
case TokenKind.Private:
|
||||
if (privateToken != null)
|
||||
{
|
||||
ReportError(token.Extent,
|
||||
nameof(ParserStrings.DuplicateQualifier),
|
||||
ParserStrings.DuplicateQualifier,
|
||||
token.Text);
|
||||
}
|
||||
|
||||
if (publicToken != null)
|
||||
{
|
||||
ReportError(token.Extent,
|
||||
nameof(ParserStrings.ModifiersCannotBeCombined),
|
||||
ParserStrings.ModifiersCannotBeCombined,
|
||||
publicToken.Text,
|
||||
token.Text);
|
||||
}
|
||||
if (publicToken != null)
|
||||
{
|
||||
ReportError(token.Extent,
|
||||
nameof(ParserStrings.ModifiersCannotBeCombined),
|
||||
ParserStrings.ModifiersCannotBeCombined,
|
||||
publicToken.Text,
|
||||
token.Text);
|
||||
}
|
||||
|
||||
privateToken = token;
|
||||
SkipToken();
|
||||
break;
|
||||
privateToken = token;
|
||||
SkipToken();
|
||||
break;
|
||||
#endif
|
||||
|
||||
case TokenKind.Hidden:
|
||||
|
@ -4529,7 +4529,7 @@ namespace System.Management.Automation.Language
|
|||
return null;
|
||||
}
|
||||
|
||||
#if FALSE
|
||||
#if SUPPORT_PUBLIC_PRIVATE
|
||||
MethodAttributes attributes = privateToken != null ? MethodAttributes.Private : MethodAttributes.Public;
|
||||
#else
|
||||
MethodAttributes attributes = MethodAttributes.Public;
|
||||
|
|
|
@ -79,7 +79,7 @@ namespace System.Management.Automation.Language
|
|||
|
||||
internal static BindingRestrictions GetSimpleTypeRestriction(this DynamicMetaObject obj)
|
||||
{
|
||||
if (obj.Value == null || ClrFacade.IsTransparentProxy(obj.Value))
|
||||
if (obj.Value == null)
|
||||
{
|
||||
return BindingRestrictions.GetInstanceRestriction(obj.Expression, obj.Value);
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ namespace System.Management.Automation.Language
|
|||
return obj.Restrictions;
|
||||
}
|
||||
|
||||
if (obj.Value == null || ClrFacade.IsTransparentProxy(obj.Value))
|
||||
if (obj.Value == null)
|
||||
{
|
||||
return BindingRestrictions.GetInstanceRestriction(obj.Expression, obj.Value);
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ namespace System.Management.Automation.Language
|
|||
return obj.Restrictions;
|
||||
}
|
||||
|
||||
if (obj.Value == null || ClrFacade.IsTransparentProxy(obj.Value))
|
||||
if (obj.Value == null)
|
||||
{
|
||||
return BindingRestrictions.GetInstanceRestriction(obj.Expression, obj.Value);
|
||||
}
|
||||
|
@ -6878,14 +6878,6 @@ namespace System.Management.Automation.Language
|
|||
argValues[i] = arg == AutomationNull.Value ? null : arg;
|
||||
}
|
||||
|
||||
if (ClrFacade.IsTransparentProxy(target.Value) && (psMethodInvocationConstraints == null || psMethodInvocationConstraints.MethodTargetType == null))
|
||||
{
|
||||
var argTypes = (psMethodInvocationConstraints == null)
|
||||
? new Type[numArgs]
|
||||
: psMethodInvocationConstraints.ParameterTypes.ToArray();
|
||||
psMethodInvocationConstraints = new PSMethodInvocationConstraints(target.Value.GetType(), argTypes);
|
||||
}
|
||||
|
||||
var result = Adapter.FindBestMethod(
|
||||
mi,
|
||||
psMethodInvocationConstraints,
|
||||
|
|
|
@ -280,19 +280,6 @@ namespace System.Management.Automation
|
|||
|
||||
#region Misc
|
||||
|
||||
/// <summary>
|
||||
/// Facade for RemotingServices.IsTransparentProxy(object)
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static bool IsTransparentProxy(object obj)
|
||||
{
|
||||
#if CORECLR // Namespace System.Runtime.Remoting is not in CoreCLR
|
||||
return false;
|
||||
#else
|
||||
return System.Runtime.Remoting.RemotingServices.IsTransparentProxy(obj);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Facade for ManagementDateTimeConverter.ToDmtfDateTime(DateTime)
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in a new issue