Imported Upstream version 4.3.2.467

Former-commit-id: 9c2cb47f45fa221e661ab616387c9cda183f283d
This commit is contained in:
Xamarin Public Jenkins
2016-02-22 11:00:01 -05:00
parent f302175246
commit f3e3aab35a
4097 changed files with 122406 additions and 82300 deletions

View File

@@ -38,7 +38,8 @@ namespace System.Linq.Expressions {
#if !SILVERLIGHT
[DebuggerTypeProxy(typeof(Expression.DynamicExpressionProxy))]
#endif
public class DynamicExpression : Expression, IArgumentProvider {
public class DynamicExpression : Expression, IDynamicExpression
{
private readonly CallSiteBinder _binder;
private readonly Type _delegateType;
@@ -413,6 +414,16 @@ namespace System.Linq.Expressions {
}
#endif // !SILVERLIGHT || FEATURE_NETCORE
#endregion
Expression IDynamicExpression.Rewrite(Expression[] args)
{
return this.Rewrite(args);
}
object IDynamicExpression.CreateCallSite()
{
return CallSite.Create(this.DelegateType, this.Binder);
}
}
#region Specialized Subclasses

View File

@@ -55,7 +55,7 @@ namespace System.Linq.Expressions {
/// an overloaded field enables us to both reduce memory usage as well as maintain compatibility and an
/// easy to use external API.
/// </summary>
internal interface IArgumentProvider {
public interface IArgumentProvider {
Expression GetArgument(int index);
int ArgumentCount {
get;

View File

@@ -0,0 +1,49 @@
/* ****************************************************************************
*
* Copyright (c) Microsoft Corporation.
*
* This source code is subject to terms and conditions of the Apache License, Version 2.0. A
* copy of the license can be found in the License.html file at the root of this distribution. If
* you cannot locate the Apache License, Version 2.0, please send an email to
* dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound
* by the terms of the Apache License, Version 2.0.
*
* You must not remove this notice, or any other, from this software.
*
*
* ***************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
#if CLR2
namespace Microsoft.Scripting.Ast {
using Microsoft.Scripting.Utils;
#else
namespace System.Linq.Expressions
{
#endif
public interface IDynamicExpression : IArgumentProvider
{
/// <summary>
/// Gets the type of the delegate used by the CallSite />.
/// </summary>
Type DelegateType { get; }
/// <summary>
/// Rewrite this node replacing the args with the provided values. The
/// number of the args needs to match the number of the current block.
///
/// This helper is provided to allow re-writing of nodes to not depend on the specific
/// class of DynamicExpression which is being used.
/// </summary>
Expression Rewrite(Expression[] args);
/// <summary>
/// Creates a CallSite for the node.
/// </summary>
object CreateCallSite();
}
}

View File

@@ -209,4 +209,4 @@ namespace System {
}
#endif
#endif