Skip to content

Commit

Permalink
Ensure consuming works from C# language version 8 (#954)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma committed Aug 31, 2021
1 parent d8282ef commit 2548f06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Jint.Tests/Jint.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<AssemblyOriginatorKeyFile>..\Jint\Jint.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<IsPackable>false</IsPackable>
<LangVersion>latest</LangVersion>
<!--
Unity currently supports only C# 8 so ensure we can use the features Jint introduces
https://docs.unity3d.com/Manual/CSharpCompiler.html
-->
<LangVersion>8</LangVersion>
<NoWarn>612</NoWarn>
</PropertyGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Jint/Runtime/Interop/TypeResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ public sealed class TypeResolver
/// <summary>
/// Registers a filter that determines whether given member is wrapped to interop or returned as undefined.
/// </summary>
public Predicate<MemberInfo> MemberFilter { get; init; } = _ => true;
public Predicate<MemberInfo> MemberFilter { get; set; } = _ => true;

/// <summary>
/// Sets member name comparison strategy when finding CLR objects members.
/// By default member's first character casing is ignored and rest of the name is compared with strict equality.
/// </summary>
public StringComparer MemberNameComparer { get; init; } = DefaultMemberNameComparer.Instance;
public StringComparer MemberNameComparer { get; set; } = DefaultMemberNameComparer.Instance;

internal ReflectionAccessor GetAccessor(Engine engine, Type type, string member, Func<ReflectionAccessor> accessorFactory = null)
{
Expand Down

0 comments on commit 2548f06

Please sign in to comment.