-
-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide a way to override interop members (#758)
- Loading branch information
1 parent
4978e9f
commit 68733e1
Showing
6 changed files
with
133 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace Jint.Tests.Runtime.Domain | ||
{ | ||
public class HiddenMembers | ||
{ | ||
public string Member1 { get; set; } = "Member1"; | ||
public string Member2 { get; set; } = "Member2"; | ||
public string Method1() | ||
{ | ||
return "Method1"; | ||
} | ||
public string Method2() | ||
{ | ||
return "Method2"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System; | ||
|
||
namespace Jint.Runtime.Interop | ||
{ | ||
internal readonly struct ClrPropertyDescriptorFactoriesKey : IEquatable<ClrPropertyDescriptorFactoriesKey> | ||
{ | ||
public ClrPropertyDescriptorFactoriesKey(Type type, Key propertyName) | ||
{ | ||
Type = type; | ||
PropertyName = propertyName; | ||
} | ||
|
||
private readonly Type Type; | ||
private readonly Key PropertyName; | ||
|
||
public bool Equals(ClrPropertyDescriptorFactoriesKey other) | ||
{ | ||
return Type == other.Type && PropertyName == other.PropertyName; | ||
} | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
if (ReferenceEquals(null, obj)) | ||
{ | ||
return false; | ||
} | ||
return obj is ClrPropertyDescriptorFactoriesKey other && Equals(other); | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
unchecked | ||
{ | ||
return (Type.GetHashCode() * 397) ^ PropertyName.GetHashCode(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters