Browse Source

net45 support. (#530)

Michael Kriese 7 years ago
parent
commit
7dbdd67c53

+ 5 - 2
Jint.Tests/Jint.Tests.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
   <PropertyGroup>
-    <TargetFramework>netcoreapp2.1</TargetFramework>
+    <TargetFrameworks>netcoreapp2.1;net452</TargetFrameworks>
   </PropertyGroup>
   </PropertyGroup>
   <ItemGroup>
   <ItemGroup>
     <EmbeddedResource Include="Runtime\Scripts\*.*;Parser\Scripts\*.*" />
     <EmbeddedResource Include="Runtime\Scripts\*.*;Parser\Scripts\*.*" />
@@ -8,6 +8,9 @@
   <ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\Jint\Jint.csproj" />
     <ProjectReference Include="..\Jint\Jint.csproj" />
   </ItemGroup>
   </ItemGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.CSharp" Condition=" '$(TargetFramework)' == 'net452' " />
+  </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
     <PackageReference Include="xunit" Version="2.4.0" />
     <PackageReference Include="xunit" Version="2.4.0" />
@@ -16,4 +19,4 @@
     <PackageReference Include="xunit.runner.console" Version="2.4.0" />
     <PackageReference Include="xunit.runner.console" Version="2.4.0" />
     <DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
     <DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
   </ItemGroup>
   </ItemGroup>
-</Project>
+</Project>

+ 5 - 4
Jint.Tests/ReplaceCulture.cs

@@ -2,6 +2,7 @@
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
 
 using System;
 using System;
+using System.Threading;
 using System.Globalization;
 using System.Globalization;
 using System.Reflection;
 using System.Reflection;
 using Xunit.Sdk;
 using Xunit.Sdk;
@@ -33,7 +34,7 @@ namespace Jint.Tests
             UICulture = new CultureInfo(currentUICulture);
             UICulture = new CultureInfo(currentUICulture);
         }
         }
 
 
-#if NET451
+#if NET451 || NET452
         /// <summary>
         /// <summary>
         /// The <see cref="Thread.CurrentCulture"/> for the test. Defaults to en-GB.
         /// The <see cref="Thread.CurrentCulture"/> for the test. Defaults to en-GB.
         /// </summary>
         /// </summary>
@@ -54,7 +55,7 @@ namespace Jint.Tests
 #endif
 #endif
         public CultureInfo Culture { get; }
         public CultureInfo Culture { get; }
 
 
-#if NET451
+#if NET451 || NET452
         /// <summary>
         /// <summary>
         /// The <see cref="Thread.CurrentUICulture"/> for the test. Defaults to en-US.
         /// The <see cref="Thread.CurrentUICulture"/> for the test. Defaults to en-US.
         /// </summary>
         /// </summary>
@@ -70,7 +71,7 @@ namespace Jint.Tests
             _originalCulture = CultureInfo.CurrentCulture;
             _originalCulture = CultureInfo.CurrentCulture;
             _originalUICulture = CultureInfo.CurrentUICulture;
             _originalUICulture = CultureInfo.CurrentUICulture;
 
 
-#if NET451
+#if NET451 || NET452
             Thread.CurrentThread.CurrentCulture = Culture;
             Thread.CurrentThread.CurrentCulture = Culture;
             Thread.CurrentThread.CurrentUICulture = UICulture;
             Thread.CurrentThread.CurrentUICulture = UICulture;
 #else
 #else
@@ -82,7 +83,7 @@ namespace Jint.Tests
 
 
         public override void After(MethodInfo methodUnderTest)
         public override void After(MethodInfo methodUnderTest)
         {
         {
-#if NET451
+#if NET451 || NET452
             Thread.CurrentThread.CurrentCulture = _originalCulture;
             Thread.CurrentThread.CurrentCulture = _originalCulture;
             Thread.CurrentThread.CurrentUICulture = _originalUICulture;
             Thread.CurrentThread.CurrentUICulture = _originalUICulture;
 #else
 #else

+ 10 - 0
Jint.Tests/Runtime/EngineTests.cs

@@ -647,6 +647,15 @@ namespace Jint.Tests.Runtime
             );
             );
         }
         }
 
 
+#if NET452
+        [Fact]
+        public void ShouldThrowMemoryLimitExceeded()
+        {
+            Assert.Throws<PlatformNotSupportedException>(
+                () => new Engine(cfg => cfg.LimitMemory(2048)).Execute("a=[]; while(true){ a.push(0); }")
+            );
+        }
+#else
         [Fact]
         [Fact]
         public void ShouldThrowMemoryLimitExceeded()
         public void ShouldThrowMemoryLimitExceeded()
         {
         {
@@ -654,6 +663,7 @@ namespace Jint.Tests.Runtime
                 () => new Engine(cfg => cfg.LimitMemory(2048)).Execute("a=[]; while(true){ a.push(0); }")
                 () => new Engine(cfg => cfg.LimitMemory(2048)).Execute("a=[]; while(true){ a.push(0); }")
             );
             );
         }
         }
+#endif
 
 
         [Fact]
         [Fact]
         public void ShouldThrowTimeout()
         public void ShouldThrowTimeout()

+ 18 - 0
Jint/ArrayExt.cs

@@ -0,0 +1,18 @@
+
+namespace System
+{
+    internal static class ArrayExt
+    {
+        private static class EmptyArray<T>
+        {
+            public static readonly T[] Value;
+
+            static EmptyArray()
+            {
+                EmptyArray<T>.Value = new T[0];
+            }
+        }
+
+        public static T[] Empty<T>() => EmptyArray<T>.Value;
+    }
+}

+ 37 - 3
Jint/Engine.cs

@@ -86,8 +86,42 @@ namespace Jint
             { typeof(System.Text.RegularExpressions.Regex), (Engine engine, object v) => engine.RegExp.Construct((System.Text.RegularExpressions.Regex)v, "") }
             { typeof(System.Text.RegularExpressions.Regex), (Engine engine, object v) => engine.RegExp.Construct((System.Text.RegularExpressions.Regex)v, "") }
         };
         };
 
 
-        internal readonly Dictionary<(Type, string), Func<Engine, object, PropertyDescriptor>> ClrPropertyDescriptorFactories =
-            new Dictionary<(Type, string), Func<Engine, object, PropertyDescriptor>>();
+        internal struct ClrPropertyDescriptorFactoriesKey : IEquatable<ClrPropertyDescriptorFactoriesKey>
+        {
+            public ClrPropertyDescriptorFactoriesKey(Type type, string propertyName)
+            {
+                Type = type;
+                PropertyName = propertyName;
+            }
+
+            internal readonly Type Type;
+            internal readonly string 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();
+                }
+            }
+        }
+
+        internal readonly Dictionary<ClrPropertyDescriptorFactoriesKey, Func<Engine, object, PropertyDescriptor>> ClrPropertyDescriptorFactories =
+            new Dictionary<ClrPropertyDescriptorFactoriesKey, Func<Engine, object, PropertyDescriptor>>();
 
 
         internal JintCallStack CallStack = new JintCallStack();
         internal JintCallStack CallStack = new JintCallStack();
 
 
@@ -209,7 +243,7 @@ namespace Jint
             _argumentsInstancePool = new ArgumentsInstancePool(this);
             _argumentsInstancePool = new ArgumentsInstancePool(this);
             _jsValueArrayPool = new JsValueArrayPool();
             _jsValueArrayPool = new JsValueArrayPool();
 
 
-            Eval = new EvalFunctionInstance(this, System.Array.Empty<string>(), LexicalEnvironment.NewDeclarativeEnvironment(this, ExecutionContext.LexicalEnvironment), StrictModeScope.IsStrictModeCode);
+            Eval = new EvalFunctionInstance(this, System.ArrayExt.Empty<string>(), LexicalEnvironment.NewDeclarativeEnvironment(this, ExecutionContext.LexicalEnvironment), StrictModeScope.IsStrictModeCode);
             Global.FastAddProperty("eval", Eval, true, false, true);
             Global.FastAddProperty("eval", Eval, true, false, true);
 
 
             _statements = new StatementInterpreter(this);
             _statements = new StatementInterpreter(this);

+ 3 - 3
Jint/Jint.csproj

@@ -1,12 +1,12 @@
 <Project Sdk="Microsoft.NET.Sdk">
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
   <PropertyGroup>
     <NeutralLanguage>en-US</NeutralLanguage>
     <NeutralLanguage>en-US</NeutralLanguage>
-    <TargetFramework>netstandard2.0</TargetFramework>
+    <TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
     <AssemblyOriginatorKeyFile>Jint.snk</AssemblyOriginatorKeyFile>
     <AssemblyOriginatorKeyFile>Jint.snk</AssemblyOriginatorKeyFile>
     <SignAssembly>true</SignAssembly>
     <SignAssembly>true</SignAssembly>
     <LangVersion>latest</LangVersion>
     <LangVersion>latest</LangVersion>
   </PropertyGroup>
   </PropertyGroup>
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="Esprima" Version="1.0.0-beta-1036" />
+    <PackageReference Include="Esprima" Version="1.0.0-beta-1049" />
   </ItemGroup>
   </ItemGroup>
-</Project>
+</Project>

+ 2 - 2
Jint/Native/Array/ArrayConstructor.cs

@@ -106,12 +106,12 @@ namespace Jint.Native.Array
             {
             {
                 ExceptionHelper.ThrowArgumentException("invalid array length", nameof(capacity));
                 ExceptionHelper.ThrowArgumentException("invalid array length", nameof(capacity));
             }
             }
-            return Construct(System.Array.Empty<JsValue>(), (uint) capacity);
+            return Construct(System.ArrayExt.Empty<JsValue>(), (uint) capacity);
         }
         }
 
 
         public ArrayInstance Construct(uint capacity)
         public ArrayInstance Construct(uint capacity)
         {
         {
-            return Construct(System.Array.Empty<JsValue>(), capacity);
+            return Construct(System.ArrayExt.Empty<JsValue>(), capacity);
         }
         }
 
 
         public ArrayInstance Construct(JsValue[] arguments, uint capacity)
         public ArrayInstance Construct(JsValue[] arguments, uint capacity)

+ 2 - 2
Jint/Native/Array/ArrayInstance.cs

@@ -26,7 +26,7 @@ namespace Jint.Native.Array
         {
         {
             if (capacity < MaxDenseArrayLength)
             if (capacity < MaxDenseArrayLength)
             {
             {
-                _dense = capacity > 0 ? new PropertyDescriptor[capacity] : System.Array.Empty<PropertyDescriptor>();
+                _dense = capacity > 0 ? new PropertyDescriptor[capacity] : System.ArrayExt.Empty<PropertyDescriptor>();
             }
             }
             else
             else
             {
             {
@@ -39,7 +39,7 @@ namespace Jint.Native.Array
             int length = 0;
             int length = 0;
             if (items == null || items.Length == 0)
             if (items == null || items.Length == 0)
             {
             {
-                _dense = System.Array.Empty<PropertyDescriptor>();
+                _dense = System.ArrayExt.Empty<PropertyDescriptor>();
                 length = 0;
                 length = 0;
             }
             }
             else
             else

+ 1 - 1
Jint/Native/Array/ArrayPrototype.cs

@@ -469,7 +469,7 @@ namespace Jint.Native.Array
             }
             }
             a.SetLength(actualDeleteCount);
             a.SetLength(actualDeleteCount);
 
 
-            var items = System.Array.Empty<JsValue>();
+            var items = System.ArrayExt.Empty<JsValue>();
             if (arguments.Length > 2)
             if (arguments.Length > 2)
             {
             {
                 items = new JsValue[arguments.Length - 2];
                 items = new JsValue[arguments.Length - 2];

+ 1 - 1
Jint/Native/Function/BindFunctionInstance.cs

@@ -7,7 +7,7 @@ namespace Jint.Native.Function
     public sealed class BindFunctionInstance : FunctionInstance, IConstructor
     public sealed class BindFunctionInstance : FunctionInstance, IConstructor
     {
     {
         public BindFunctionInstance(Engine engine)
         public BindFunctionInstance(Engine engine)
-            : base(engine, "bind", System.Array.Empty<string>(), null, false)
+            : base(engine, "bind", System.ArrayExt.Empty<string>(), null, false)
         {
         {
         }
         }
 
 

+ 1 - 1
Jint/Native/Function/ScriptFunctionInstance.cs

@@ -66,7 +66,7 @@ namespace Jint.Native.Function
 
 
             if (count == 0)
             if (count == 0)
             {
             {
-                return System.Array.Empty<string>();
+                return System.ArrayExt.Empty<string>();
             }
             }
 
 
             var names = new string[count];
             var names = new string[count];

+ 1 - 1
Jint/Native/Function/ThrowTypeError.cs

@@ -6,7 +6,7 @@ namespace Jint.Native.Function
     public sealed class ThrowTypeError : FunctionInstance
     public sealed class ThrowTypeError : FunctionInstance
     {
     {
         public ThrowTypeError(Engine engine)
         public ThrowTypeError(Engine engine)
-            : base(engine, "throwTypeError", System.Array.Empty<string>(), engine.GlobalEnvironment, false)
+            : base(engine, "throwTypeError", System.ArrayExt.Empty<string>(), engine.GlobalEnvironment, false)
         {
         {
             DefineOwnProperty("length", new PropertyDescriptor(0, PropertyFlag.AllForbidden), false);
             DefineOwnProperty("length", new PropertyDescriptor(0, PropertyFlag.AllForbidden), false);
             Extensible = false;
             Extensible = false;

+ 1 - 1
Jint/Native/Global/GlobalObject.cs

@@ -446,7 +446,7 @@ namespace Jint.Native.Global
                         v = (c - 0xD800) * 0x400 + (kChar - 0xDC00) + 0x10000;
                         v = (c - 0xD800) * 0x400 + (kChar - 0xDC00) + 0x10000;
                     }
                     }
 
 
-                    byte[] octets = System.Array.Empty<byte>();
+                    byte[] octets = System.ArrayExt.Empty<byte>();
 
 
                     if (v >= 0 && v <= 0x007F)
                     if (v >= 0 && v <= 0x007F)
                     {
                     {

+ 2 - 2
Jint/Native/Iterator/IteratorInstance.cs

@@ -231,14 +231,14 @@ namespace Jint.Native.Iterator
 
 
             public ObjectInstance Next()
             public ObjectInstance Next()
             {
             {
-                return (ObjectInstance) _callable.Call(_target, System.Array.Empty<JsValue>());
+                return (ObjectInstance) _callable.Call(_target, Arguments.Empty);
             }
             }
 
 
             public void Return()
             public void Return()
             {
             {
                 if (_target.TryGetValue("return", out var func))
                 if (_target.TryGetValue("return", out var func))
                 {
                 {
-                    ((ICallable) func).Call(_target, System.Array.Empty<JsValue>());
+                    ((ICallable) func).Call(_target, Arguments.Empty);
                 }
                 }
             }
             }
         }
         }

+ 13 - 2
Jint/Native/Number/Dtoa/CachePowers.cs

@@ -50,8 +50,19 @@ namespace Jint.Native.Number.Dtoa
             }
             }
         }
         }
 
 
+        internal readonly struct GetCachedPowerResult
+        {
+            public GetCachedPowerResult(short decimalExponent, DiyFp cMk)
+            {
+                this.decimalExponent = decimalExponent;
+                this.cMk = cMk;
+            }
+
+            internal readonly short decimalExponent;
+            internal readonly DiyFp cMk;
+        }
 
 
-        internal static (short, DiyFp) GetCachedPower(int e, int alpha, int gamma)
+        internal static GetCachedPowerResult GetCachedPower(int e, int alpha, int gamma)
         {
         {
             const int kQ = DiyFp.KSignificandSize;
             const int kQ = DiyFp.KSignificandSize;
             double k = System.Math.Ceiling((alpha - e + kQ - 1) * Kd1Log210);
             double k = System.Math.Ceiling((alpha - e + kQ - 1) * Kd1Log210);
@@ -60,7 +71,7 @@ namespace Jint.Native.Number.Dtoa
 
 
             var cMk = new DiyFp(cachedPower.Significand, cachedPower.BinaryExponent);
             var cMk = new DiyFp(cachedPower.Significand, cachedPower.BinaryExponent);
             Debug.Assert((alpha <= cMk.E + e) && (cMk.E + e <= gamma));
             Debug.Assert((alpha <= cMk.E + e) && (cMk.E + e <= gamma));
-            return (cachedPower.DecimalExponent, cMk);
+            return new GetCachedPowerResult(cachedPower.DecimalExponent, cMk);
         }
         }
 
 
         // Code below is converted from GRISU_CACHE_NAME(8) in file "powers-ten.h"
         // Code below is converted from GRISU_CACHE_NAME(8) in file "powers-ten.h"

+ 14 - 2
Jint/Native/Number/Dtoa/DoubleHelper.cs

@@ -101,10 +101,22 @@ namespace Jint.Native.Number.Dtoa
             return (d64 & KExponentMask) == KExponentMask;
             return (d64 & KExponentMask) == KExponentMask;
         }
         }
 
 
+        internal readonly struct NormalizedBoundariesResult
+        {
+            public NormalizedBoundariesResult(DiyFp minus, DiyFp plus)
+            {
+                Minus = minus;
+                Plus = plus;
+            }
+
+            internal readonly DiyFp Minus;
+            internal readonly DiyFp Plus;
+        }
+
         // Returns the two boundaries of first argument.
         // Returns the two boundaries of first argument.
         // The bigger boundary (m_plus) is normalized. The lower boundary has the same
         // The bigger boundary (m_plus) is normalized. The lower boundary has the same
         // exponent as m_plus.
         // exponent as m_plus.
-        internal static (DiyFp, DiyFp) NormalizedBoundaries(long d64)
+        internal static NormalizedBoundariesResult NormalizedBoundaries(long d64)
         {
         {
             DiyFp v = AsDiyFp(d64);
             DiyFp v = AsDiyFp(d64);
             bool significandIsZero = (v.F == KHiddenBit);
             bool significandIsZero = (v.F == KHiddenBit);
@@ -125,7 +137,7 @@ namespace Jint.Native.Number.Dtoa
                 mMinus = new DiyFp((v.F << 1) - 1, v.E - 1);
                 mMinus = new DiyFp((v.F << 1) - 1, v.E - 1);
             }
             }
             mMinus = new DiyFp(mMinus.F << (mMinus.E - mPlus.E), mPlus.E);
             mMinus = new DiyFp(mMinus.F << (mMinus.E - mPlus.E), mPlus.E);
-            return (mMinus, mPlus);
+            return new NormalizedBoundariesResult(mMinus, mPlus);
         }
         }
 
 
         private const int KSignificandSize = 52; // Excludes the hidden bit.
         private const int KSignificandSize = 52; // Excludes the hidden bit.

+ 8 - 2
Jint/Native/Number/Dtoa/FastDtoa.cs

@@ -470,13 +470,19 @@ namespace Jint.Native.Number.Dtoa
             // closest floating-point neighbors. Any number strictly between
             // closest floating-point neighbors. Any number strictly between
             // boundary_minus and boundary_plus will round to v when convert to a double.
             // boundary_minus and boundary_plus will round to v when convert to a double.
             // Grisu3 will never output representations that lie exactly on a boundary.
             // Grisu3 will never output representations that lie exactly on a boundary.
-            (DiyFp boundaryMinus, DiyFp boundaryPlus) = DoubleHelper.NormalizedBoundaries(bits);
+            var boundaries = DoubleHelper.NormalizedBoundaries(bits);
+            var boundaryMinus = boundaries.Minus;
+            var boundaryPlus = boundaries.Plus;
+
             Debug.Assert(boundaryPlus.E == w.E);
             Debug.Assert(boundaryPlus.E == w.E);
 
 
-            var (mk, tenMk) = CachedPowers.GetCachedPower(
+            var result = CachedPowers.GetCachedPower(
                 w.E + DiyFp.KSignificandSize,
                 w.E + DiyFp.KSignificandSize,
                 MinimalTargetExponent, MaximalTargetExponent);
                 MinimalTargetExponent, MaximalTargetExponent);
 
 
+            var mk = result.decimalExponent;
+            var tenMk = result.cMk;
+
             Debug.Assert(MinimalTargetExponent <= w.E + tenMk.E +
             Debug.Assert(MinimalTargetExponent <= w.E + tenMk.E +
                          DiyFp.KSignificandSize &&
                          DiyFp.KSignificandSize &&
                          MaximalTargetExponent >= w.E + tenMk.E +
                          MaximalTargetExponent >= w.E + tenMk.E +

+ 1 - 1
Jint/Pooling/JsValueArrayPool.cs

@@ -41,7 +41,7 @@ namespace Jint.Pooling
         {
         {
             if (size == 0)
             if (size == 0)
             {
             {
-                return Array.Empty<JsValue>();
+                return ArrayExt.Empty<JsValue>();
             }
             }
             if (size == 1)
             if (size == 1)
             {
             {

+ 2 - 2
Jint/Runtime/Arguments.cs

@@ -6,7 +6,7 @@ namespace Jint.Runtime
 {
 {
     public static class Arguments
     public static class Arguments
     {
     {
-        public static readonly JsValue[] Empty = Array.Empty<JsValue>();
+        public static readonly JsValue[] Empty = ArrayExt.Empty<JsValue>();
 
 
         public static JsValue[] From(params JsValue[] o)
         public static JsValue[] From(params JsValue[] o)
         {
         {
@@ -38,7 +38,7 @@ namespace Jint.Runtime
             var newLength = args.Length - count;
             var newLength = args.Length - count;
             if (newLength <= 0)
             if (newLength <= 0)
             {
             {
-                return Array.Empty<JsValue>();
+                return ArrayExt.Empty<JsValue>();
             }
             }
 
 
             var array = new JsValue[newLength];
             var array = new JsValue[newLength];

+ 1 - 1
Jint/Runtime/Environments/DeclarativeEnvironmentRecord.cs

@@ -188,7 +188,7 @@ namespace Jint.Runtime.Environments
                 size += _dictionary.Count;
                 size += _dictionary.Count;
             }
             }
 
 
-            var keys = size > 0 ? new string[size] : Array.Empty<string>();
+            var keys = size > 0 ? new string[size] : ArrayExt.Empty<string>();
             int n = 0;
             int n = 0;
             if (_set)
             if (_set)
             {
             {

+ 1 - 1
Jint/Runtime/Environments/ObjectEnvironmentRecord.cs

@@ -76,7 +76,7 @@ namespace Jint.Runtime.Environments
                 return _bindingObject.GetOwnProperties().Select( x=> x.Key).ToArray();
                 return _bindingObject.GetOwnProperties().Select( x=> x.Key).ToArray();
             }
             }
 
 
-            return Array.Empty<string>();
+            return ArrayExt.Empty<string>();
         }
         }
     }
     }
 }
 }

+ 1 - 1
Jint/Runtime/ExpressionIntepreter.cs

@@ -787,7 +787,7 @@ namespace Jint.Runtime
 
 
             // todo: implement as in http://www.ecma-international.org/ecma-262/5.1/#sec-11.2.4
             // todo: implement as in http://www.ecma-international.org/ecma-262/5.1/#sec-11.2.4
 
 
-            var arguments = Array.Empty<JsValue>();
+            var arguments = ArrayExt.Empty<JsValue>();
             if (callExpression.Cached)
             if (callExpression.Cached)
             {
             {
                 arguments = (JsValue[]) callExpression.CachedArguments;
                 arguments = (JsValue[]) callExpression.CachedArguments;

+ 1 - 1
Jint/Runtime/Interop/DefaultTypeConverter.cs

@@ -139,7 +139,7 @@ namespace Jint.Runtime.Interop
                 {
                 {
                     if (type == typeof(Action))
                     if (type == typeof(Action))
                     {
                     {
-                        return (Action)(() => function(JsValue.Undefined, Array.Empty<JsValue>()));
+                        return (Action)(() => function(JsValue.Undefined, ArrayExt.Empty<JsValue>()));
                     }
                     }
                     else if (typeof(MulticastDelegate).IsAssignableFrom(type))
                     else if (typeof(MulticastDelegate).IsAssignableFrom(type))
                     {
                     {

+ 1 - 1
Jint/Runtime/Interop/ObjectWrapper.cs

@@ -56,7 +56,7 @@ namespace Jint.Runtime.Interop
             }
             }
 
 
             var type = Target.GetType();
             var type = Target.GetType();
-            var key = (type, propertyName);
+            var key = new Engine.ClrPropertyDescriptorFactoriesKey(type, propertyName);
 
 
             if (!_engine.ClrPropertyDescriptorFactories.TryGetValue(key, out var factory))
             if (!_engine.ClrPropertyDescriptorFactories.TryGetValue(key, out var factory))
             {
             {

+ 1 - 1
NuGet.config

@@ -6,4 +6,4 @@
     <add key="Esprima" value="https://www.myget.org/F/esprimadotnet/api/v3/index.json" />
     <add key="Esprima" value="https://www.myget.org/F/esprimadotnet/api/v3/index.json" />
   </packageSources>
   </packageSources>
   <disabledPackageSources />
   <disabledPackageSources />
-</configuration>
+</configuration>