progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
50
AspClassic.VBScript/Runtime/InvokeMemberBinderKey.cs
Normal file
50
AspClassic.VBScript/Runtime/InvokeMemberBinderKey.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
//using System.Text;
|
||||
using System.Reflection;
|
||||
using System.Dynamic;
|
||||
#if USE35
|
||||
using AspClassic.Scripting.Ast;
|
||||
using AspClassic.Scripting.Utils;
|
||||
#else
|
||||
using System.Linq.Expressions;
|
||||
#endif
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Dlrsoft.VBScript.Runtime
|
||||
{
|
||||
// This class is needed to canonicalize InvokeMemberBinders in Sympl. See
|
||||
// the comment above the GetXXXBinder methods at the end of the Sympl class.
|
||||
//
|
||||
public class InvokeMemberBinderKey
|
||||
{
|
||||
string _name;
|
||||
CallInfo _info;
|
||||
|
||||
public InvokeMemberBinderKey(string name, CallInfo info)
|
||||
{
|
||||
_name = name;
|
||||
_info = info;
|
||||
}
|
||||
|
||||
public string Name { get { return _name; } }
|
||||
public CallInfo Info { get { return _info; } }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
InvokeMemberBinderKey key = obj as InvokeMemberBinderKey;
|
||||
// Don't lower the name. Sympl is case-preserving in the metadata
|
||||
// in case some DynamicMetaObject ignores ignoreCase. This makes
|
||||
// some interop cases work, but the cost is that if a Sympl program
|
||||
// spells ".foo" and ".Foo" at different sites, they won't share rules.
|
||||
return key != null && key._name == _name && key._info.Equals(_info);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// Stolen from DLR sources when it overrode GetHashCode on binders.
|
||||
return 0x28000000 ^ _name.GetHashCode() ^ _info.GetHashCode();
|
||||
}
|
||||
|
||||
} //InvokeMemberBinderKey
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue