Quellcode durchsuchen

Create global alias for JsValue[] arguments (#2055)

Marko Lahma vor 5 Monaten
Ursprung
Commit
27d3ce989d
100 geänderte Dateien mit 678 neuen und 675 gelöschten Zeilen
  1. 1 1
      Jint/AstExtensions.cs
  2. 1 1
      Jint/Collections/RefStack.cs
  3. 15 15
      Jint/Engine.cs
  4. 3 0
      Jint/GlobalUsings.cs
  5. 2 2
      Jint/JsValueExtensions.cs
  6. 2 2
      Jint/Native/AggregateError/AggregateErrorConstructor.cs
  7. 22 28
      Jint/Native/Array/ArrayConstructor.cs
  8. 4 4
      Jint/Native/Array/ArrayInstance.cs
  9. 1 1
      Jint/Native/Array/ArrayOperations.cs
  10. 41 41
      Jint/Native/Array/ArrayPrototype.cs
  11. 3 3
      Jint/Native/ArrayBuffer/ArrayBufferConstructor.cs
  12. 9 9
      Jint/Native/ArrayBuffer/ArrayBufferPrototype.cs
  13. 2 2
      Jint/Native/AsyncFunction/AsyncFunctionConstructor.cs
  14. 2 2
      Jint/Native/AsyncGenerator/AsyncGeneratorFunctionConstructor.cs
  15. 3 3
      Jint/Native/AsyncGenerator/AsyncGeneratorPrototype.cs
  16. 1 1
      Jint/Native/Atomics/AtomicsInstance.cs
  17. 4 4
      Jint/Native/BigInt/BigIntConstructor.cs
  18. 3 3
      Jint/Native/BigInt/BigIntPrototype.cs
  19. 2 2
      Jint/Native/Boolean/BooleanConstructor.cs
  20. 2 2
      Jint/Native/Boolean/BooleanPrototype.cs
  21. 2 2
      Jint/Native/Constructor.cs
  22. 1 1
      Jint/Native/DataView/DataViewConstructor.cs
  23. 25 25
      Jint/Native/DataView/DataViewPrototype.cs
  24. 6 6
      Jint/Native/Date/DateConstructor.cs
  25. 53 53
      Jint/Native/Date/DatePrototype.cs
  26. 2 2
      Jint/Native/Date/MimeKit.cs
  27. 4 4
      Jint/Native/Error/ErrorConstructor.cs
  28. 1 1
      Jint/Native/Error/ErrorPrototype.cs
  29. 2 2
      Jint/Native/FinalizationRegistry/FinalizationRegistryConstructor.cs
  30. 2 2
      Jint/Native/FinalizationRegistry/FinalizationRegistryPrototype.cs
  31. 3 3
      Jint/Native/Function/BindFunction.cs
  32. 1 1
      Jint/Native/Function/EvalFunction.cs
  33. 3 3
      Jint/Native/Function/Function.cs
  34. 2 2
      Jint/Native/Function/FunctionConstructor.cs
  35. 1 1
      Jint/Native/Function/FunctionInstance.Dynamic.cs
  36. 8 9
      Jint/Native/Function/FunctionPrototype.cs
  37. 2 2
      Jint/Native/Function/ScriptFunction.cs
  38. 1 1
      Jint/Native/Function/ThrowTypeError.cs
  39. 2 2
      Jint/Native/Generator/GeneratorFunctionConstructor.cs
  40. 3 3
      Jint/Native/Generator/GeneratorPrototype.cs
  41. 12 12
      Jint/Native/Global/GlobalObject.cs
  42. 1 1
      Jint/Native/ICallable.cs
  43. 1 1
      Jint/Native/IConstructor.cs
  44. 1 1
      Jint/Native/Intl/CollatorConstructor.cs
  45. 1 1
      Jint/Native/Intl/DateTimeFormatConstructor.cs
  46. 1 1
      Jint/Native/Intl/DisplayNamesConstructor.cs
  47. 1 1
      Jint/Native/Intl/IntlInstance.cs
  48. 1 1
      Jint/Native/Intl/ListFormatConstructor.cs
  49. 1 1
      Jint/Native/Intl/LocaleConstructor.cs
  50. 4 4
      Jint/Native/Intl/NumberFormatConstructor.cs
  51. 1 1
      Jint/Native/Intl/PluralRulesConstructor.cs
  52. 1 1
      Jint/Native/Intl/RelativeTimeFormatConstructor.cs
  53. 1 1
      Jint/Native/Intl/SegmenterConstructor.cs
  54. 2 2
      Jint/Native/Iterator/IteratorPrototype.cs
  55. 1 1
      Jint/Native/Iterator/IteratorResult.cs
  56. 1 1
      Jint/Native/JsArguments.cs
  57. 1 1
      Jint/Native/JsArrayBuffer.cs
  58. 2 2
      Jint/Native/JsPromise.cs
  59. 14 14
      Jint/Native/JsProxy.cs
  60. 1 1
      Jint/Native/JsValue.cs
  61. 3 3
      Jint/Native/Json/JsonInstance.cs
  62. 2 2
      Jint/Native/Json/JsonSerializer.cs
  63. 3 3
      Jint/Native/Map/MapConstructor.cs
  64. 10 10
      Jint/Native/Map/MapPrototype.cs
  65. 38 38
      Jint/Native/Math/MathInstance.cs
  66. 2 2
      Jint/Native/Number/Dtoa/CachePowers.cs
  67. 7 7
      Jint/Native/Number/NumberConstructor.cs
  68. 6 6
      Jint/Native/Number/NumberPrototype.cs
  69. 27 27
      Jint/Native/Object/ObjectConstructor.cs
  70. 1 1
      Jint/Native/Object/ObjectInstance.Private.cs
  71. 19 10
      Jint/Native/Object/ObjectInstance.cs
  72. 11 11
      Jint/Native/Object/ObjectPrototype.cs
  73. 39 39
      Jint/Native/Promise/PromiseConstructor.cs
  74. 7 7
      Jint/Native/Promise/PromiseOperations.cs
  75. 8 8
      Jint/Native/Promise/PromisePrototype.cs
  76. 4 4
      Jint/Native/Proxy/ProxyConstructor.cs
  77. 13 13
      Jint/Native/Reflect/ReflectInstance.cs
  78. 3 3
      Jint/Native/RegExp/RegExpConstructor.cs
  79. 18 20
      Jint/Native/RegExp/RegExpPrototype.cs
  80. 2 2
      Jint/Native/Set/SetConstructor.cs
  81. 15 15
      Jint/Native/Set/SetPrototype.cs
  82. 2 2
      Jint/Native/ShadowRealm/ShadowRealm.cs
  83. 1 1
      Jint/Native/ShadowRealm/ShadowRealmConstructor.cs
  84. 2 2
      Jint/Native/ShadowRealm/ShadowRealmPrototype.cs
  85. 4 4
      Jint/Native/SharedArrayBuffer/SharedArrayBufferConstructor.cs
  86. 6 6
      Jint/Native/SharedArrayBuffer/SharedArrayBufferPrototype.cs
  87. 5 5
      Jint/Native/String/StringConstructor.cs
  88. 44 44
      Jint/Native/String/StringPrototype.cs
  89. 4 4
      Jint/Native/Symbol/SymbolConstructor.cs
  90. 4 4
      Jint/Native/Symbol/SymbolPrototype.cs
  91. 14 14
      Jint/Native/TypedArray/IntrinsicTypedArrayConstructor.cs
  92. 43 43
      Jint/Native/TypedArray/IntrinsicTypedArrayPrototype.cs
  93. 2 2
      Jint/Native/TypedArray/TypedArrayConstructor.Uint8Array.cs
  94. 1 1
      Jint/Native/TypedArray/TypedArrayConstructor.cs
  95. 4 4
      Jint/Native/TypedArray/Uint8ArrayPrototype.cs
  96. 1 1
      Jint/Native/WeakMap/WeakMapConstructor.cs
  97. 4 4
      Jint/Native/WeakMap/WeakMapPrototype.cs
  98. 1 1
      Jint/Native/WeakRef/WeakRefConstructor.cs
  99. 1 1
      Jint/Native/WeakRef/WeakRefPrototype.cs
  100. 1 1
      Jint/Native/WeakSet/WeakSetConstructor.cs

+ 1 - 1
Jint/AstExtensions.cs

@@ -362,7 +362,7 @@ public static class AstExtensions
     {
     {
         if (importAttributes.Count == 0)
         if (importAttributes.Count == 0)
         {
         {
-            return Array.Empty<ModuleImportAttribute>();
+            return [];
         }
         }
 
 
         var attributes = new ModuleImportAttribute[importAttributes.Count];
         var attributes = new ModuleImportAttribute[importAttributes.Count];

+ 1 - 1
Jint/Collections/RefStack.cs

@@ -106,7 +106,7 @@ internal sealed class RefStack<T> : IEnumerable<T> where T : struct
             }
             }
             else
             else
             {
             {
-                _array = Array.Empty<T>();
+                _array = [];
             }
             }
         }
         }
     }
     }

+ 15 - 15
Jint/Engine.cs

@@ -494,7 +494,7 @@ public sealed partial class Engine : IDisposable
 
 
         Action<JsValue> SettleWith(Function settle) => value =>
         Action<JsValue> SettleWith(Function settle) => value =>
         {
         {
-            settle.Call(JsValue.Undefined, new[] { value });
+            settle.Call(JsValue.Undefined, [value]);
             RunAvailableContinuations();
             RunAvailableContinuations();
         };
         };
 
 
@@ -833,7 +833,7 @@ public sealed partial class Engine : IDisposable
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-invoke
     /// https://tc39.es/ecma262/#sec-invoke
     /// </summary>
     /// </summary>
-    internal JsValue Invoke(JsValue v, JsValue p, JsValue[] arguments)
+    internal JsValue Invoke(JsValue v, JsValue p, JsCallArguments arguments)
     {
     {
         var ownsContext = _activeEvaluationContext is null;
         var ownsContext = _activeEvaluationContext is null;
         _activeEvaluationContext ??= new EvaluationContext(this);
         _activeEvaluationContext ??= new EvaluationContext(this);
@@ -1046,7 +1046,7 @@ public sealed partial class Engine : IDisposable
     /// </summary>
     /// </summary>
     internal JsArguments? FunctionDeclarationInstantiation(
     internal JsArguments? FunctionDeclarationInstantiation(
         Function function,
         Function function,
-        JsValue[] argumentsList)
+        JsCallArguments argumentsList)
     {
     {
         var calleeContext = ExecutionContext;
         var calleeContext = ExecutionContext;
         var func = function._functionDefinition;
         var func = function._functionDefinition;
@@ -1195,14 +1195,14 @@ public sealed partial class Engine : IDisposable
     private JsArguments CreateMappedArgumentsObject(
     private JsArguments CreateMappedArgumentsObject(
         Function func,
         Function func,
         Key[] formals,
         Key[] formals,
-        JsValue[] argumentsList,
+        JsCallArguments argumentsList,
         DeclarativeEnvironment envRec,
         DeclarativeEnvironment envRec,
         bool hasRestParameter)
         bool hasRestParameter)
     {
     {
         return _argumentsInstancePool.Rent(func, formals, argumentsList, envRec, hasRestParameter);
         return _argumentsInstancePool.Rent(func, formals, argumentsList, envRec, hasRestParameter);
     }
     }
 
 
-    private JsArguments CreateUnmappedArgumentsObject(JsValue[] argumentsList)
+    private JsArguments CreateUnmappedArgumentsObject(JsCallArguments argumentsList)
     {
     {
         return _argumentsInstancePool.Rent(argumentsList);
         return _argumentsInstancePool.Rent(argumentsList);
     }
     }
@@ -1424,7 +1424,7 @@ public sealed partial class Engine : IDisposable
     /// <param name="callableName">The name of the callable.</param>
     /// <param name="callableName">The name of the callable.</param>
     /// <param name="arguments">The arguments of the call.</param>
     /// <param name="arguments">The arguments of the call.</param>
     /// <returns>The value returned by the call.</returns>
     /// <returns>The value returned by the call.</returns>
-    public JsValue Call(string callableName, params JsValue[] arguments)
+    public JsValue Call(string callableName, params JsCallArguments arguments)
     {
     {
         var callable = Evaluate(callableName);
         var callable = Evaluate(callableName);
         return Call(callable, arguments);
         return Call(callable, arguments);
@@ -1436,7 +1436,7 @@ public sealed partial class Engine : IDisposable
     /// <param name="callable">The callable.</param>
     /// <param name="callable">The callable.</param>
     /// <param name="arguments">The arguments of the call.</param>
     /// <param name="arguments">The arguments of the call.</param>
     /// <returns>The value returned by the call.</returns>
     /// <returns>The value returned by the call.</returns>
-    public JsValue Call(JsValue callable, params JsValue[] arguments)
+    public JsValue Call(JsValue callable, params JsCallArguments arguments)
         => Call(callable, thisObject: JsValue.Undefined, arguments);
         => Call(callable, thisObject: JsValue.Undefined, arguments);
 
 
     /// <summary>
     /// <summary>
@@ -1446,7 +1446,7 @@ public sealed partial class Engine : IDisposable
     /// <param name="thisObject">Value bound as this.</param>
     /// <param name="thisObject">Value bound as this.</param>
     /// <param name="arguments">The arguments of the call.</param>
     /// <param name="arguments">The arguments of the call.</param>
     /// <returns>The value returned by the call.</returns>
     /// <returns>The value returned by the call.</returns>
-    public JsValue Call(JsValue callable, JsValue thisObject, JsValue[] arguments)
+    public JsValue Call(JsValue callable, JsValue thisObject, JsCallArguments arguments)
     {
     {
         JsValue Callback()
         JsValue Callback()
         {
         {
@@ -1462,7 +1462,7 @@ public sealed partial class Engine : IDisposable
     }
     }
 
 
     [MethodImpl(MethodImplOptions.AggressiveInlining)]
     [MethodImpl(MethodImplOptions.AggressiveInlining)]
-    internal JsValue Call(ICallable callable, JsValue thisObject, JsValue[] arguments, JintExpression? expression)
+    internal JsValue Call(ICallable callable, JsValue thisObject, JsCallArguments arguments, JintExpression? expression)
     {
     {
         if (callable is Function functionInstance)
         if (callable is Function functionInstance)
         {
         {
@@ -1478,7 +1478,7 @@ public sealed partial class Engine : IDisposable
     /// <param name="constructorName">The name of the constructor to call.</param>
     /// <param name="constructorName">The name of the constructor to call.</param>
     /// <param name="arguments">The arguments of the constructor call.</param>
     /// <param name="arguments">The arguments of the constructor call.</param>
     /// <returns>The value returned by the constructor call.</returns>
     /// <returns>The value returned by the constructor call.</returns>
-    public ObjectInstance Construct(string constructorName, params JsValue[] arguments)
+    public ObjectInstance Construct(string constructorName, params JsCallArguments arguments)
     {
     {
         var constructor = Evaluate(constructorName);
         var constructor = Evaluate(constructorName);
         return Construct(constructor, arguments);
         return Construct(constructor, arguments);
@@ -1490,7 +1490,7 @@ public sealed partial class Engine : IDisposable
     /// <param name="constructor">The name of the constructor to call.</param>
     /// <param name="constructor">The name of the constructor to call.</param>
     /// <param name="arguments">The arguments of the constructor call.</param>
     /// <param name="arguments">The arguments of the constructor call.</param>
     /// <returns>The value returned by the constructor call.</returns>
     /// <returns>The value returned by the constructor call.</returns>
-    public ObjectInstance Construct(JsValue constructor, params JsValue[] arguments)
+    public ObjectInstance Construct(JsValue constructor, params JsCallArguments arguments)
     {
     {
         ObjectInstance Callback()
         ObjectInstance Callback()
         {
         {
@@ -1507,7 +1507,7 @@ public sealed partial class Engine : IDisposable
 
 
     internal ObjectInstance Construct(
     internal ObjectInstance Construct(
         JsValue constructor,
         JsValue constructor,
-        JsValue[] arguments,
+        JsCallArguments arguments,
         JsValue newTarget,
         JsValue newTarget,
         JintExpression? expression)
         JintExpression? expression)
     {
     {
@@ -1525,7 +1525,7 @@ public sealed partial class Engine : IDisposable
     internal JsValue Call(
     internal JsValue Call(
         Function function,
         Function function,
         JsValue thisObject,
         JsValue thisObject,
-        JsValue[] arguments,
+        JsCallArguments arguments,
         JintExpression? expression)
         JintExpression? expression)
     {
     {
         // ensure logic is in sync between Call, Construct, engine.Invoke and JintCallExpression!
         // ensure logic is in sync between Call, Construct, engine.Invoke and JintCallExpression!
@@ -1557,7 +1557,7 @@ public sealed partial class Engine : IDisposable
 
 
     private ObjectInstance Construct(
     private ObjectInstance Construct(
         Function function,
         Function function,
-        JsValue[] arguments,
+        JsCallArguments arguments,
         JsValue newTarget,
         JsValue newTarget,
         JintExpression? expression)
         JintExpression? expression)
     {
     {
@@ -1612,7 +1612,7 @@ public sealed partial class Engine : IDisposable
 #else
 #else
         // we can expect that reflection is OK as we've been generating object wrappers already
         // we can expect that reflection is OK as we've been generating object wrappers already
         var clearMethod = _objectWrapperCache.GetType().GetMethod("Clear", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
         var clearMethod = _objectWrapperCache.GetType().GetMethod("Clear", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
-        clearMethod?.Invoke(_objectWrapperCache, Array.Empty<object>());
+        clearMethod?.Invoke(_objectWrapperCache, []);
 #endif
 #endif
     }
     }
 
 

+ 3 - 0
Jint/GlobalUsings.cs

@@ -1,2 +1,5 @@
 global using PropertyDictionary = Jint.Collections.HybridDictionary<Jint.Runtime.Descriptors.PropertyDescriptor>;
 global using PropertyDictionary = Jint.Collections.HybridDictionary<Jint.Runtime.Descriptors.PropertyDescriptor>;
 global using SymbolDictionary = Jint.Collections.DictionarySlim<Jint.Native.JsSymbol, Jint.Runtime.Descriptors.PropertyDescriptor>;
 global using SymbolDictionary = Jint.Collections.DictionarySlim<Jint.Native.JsSymbol, Jint.Runtime.Descriptors.PropertyDescriptor>;
+
+global using JsCallDelegate = System.Func<Jint.Native.JsValue, Jint.Native.JsValue[], Jint.Native.JsValue>;
+global using JsCallArguments = Jint.Native.JsValue[];

+ 2 - 2
Jint/JsValueExtensions.cs

@@ -607,7 +607,7 @@ public static class JsValueExtensions
     }
     }
 
 
     [Pure]
     [Pure]
-    public static JsValue Call(this JsValue value, params JsValue[] arguments)
+    public static JsValue Call(this JsValue value, params JsCallArguments arguments)
     {
     {
         if (value is ObjectInstance objectInstance)
         if (value is ObjectInstance objectInstance)
         {
         {
@@ -618,7 +618,7 @@ public static class JsValueExtensions
     }
     }
 
 
     [MethodImpl(MethodImplOptions.AggressiveInlining)]
     [MethodImpl(MethodImplOptions.AggressiveInlining)]
-    public static JsValue Call(this JsValue value, JsValue thisObj, JsValue[] arguments)
+    public static JsValue Call(this JsValue value, JsValue thisObj, JsCallArguments arguments)
     {
     {
         if (value is ObjectInstance objectInstance)
         if (value is ObjectInstance objectInstance)
         {
         {

+ 2 - 2
Jint/Native/AggregateError/AggregateErrorConstructor.cs

@@ -27,7 +27,7 @@ internal sealed class AggregateErrorConstructor : Constructor
 
 
     private AggregateErrorPrototype PrototypeObject { get; }
     private AggregateErrorPrototype PrototypeObject { get; }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return Construct(arguments, this);
         return Construct(arguments, this);
     }
     }
@@ -35,7 +35,7 @@ internal sealed class AggregateErrorConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-nativeerror
     /// https://tc39.es/ecma262/#sec-nativeerror
     /// </summary>
     /// </summary>
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var errors = arguments.At(0);
         var errors = arguments.At(0);
         var message = arguments.At(1);
         var message = arguments.At(1);

+ 22 - 28
Jint/Native/Array/ArrayConstructor.cs

@@ -51,7 +51,7 @@ public sealed class ArrayConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.from
     /// https://tc39.es/ecma262/#sec-array.from
     /// </summary>
     /// </summary>
-    private JsValue From(JsValue thisObject, JsValue[] arguments)
+    private JsValue From(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var items = arguments.At(0);
         var items = arguments.At(0);
         var mapFunction = arguments.At(1);
         var mapFunction = arguments.At(1);
@@ -69,7 +69,7 @@ public sealed class ArrayConstructor : Constructor
             ObjectInstance instance;
             ObjectInstance instance;
             if (!ReferenceEquals(this, thisObject) && thisObject is IConstructor constructor)
             if (!ReferenceEquals(this, thisObject) && thisObject is IConstructor constructor)
             {
             {
-                instance = constructor.Construct(System.Array.Empty<JsValue>(), thisObject);
+                instance = constructor.Construct([], thisObject);
             }
             }
             else
             else
             {
             {
@@ -185,13 +185,13 @@ public sealed class ArrayConstructor : Constructor
         }
         }
     }
     }
 
 
-    private JsValue Of(JsValue thisObject, JsValue[] arguments)
+    private JsValue Of(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var len = arguments.Length;
         var len = arguments.Length;
         ObjectInstance a;
         ObjectInstance a;
         if (thisObject.IsConstructor)
         if (thisObject.IsConstructor)
         {
         {
-            a = ((IConstructor) thisObject).Construct(new JsValue[] { len }, thisObject);
+            a = ((IConstructor) thisObject).Construct([len], thisObject);
         }
         }
         else
         else
         {
         {
@@ -203,7 +203,7 @@ public sealed class ArrayConstructor : Constructor
             // faster for real arrays
             // faster for real arrays
             for (uint k = 0; k < arguments.Length; k++)
             for (uint k = 0; k < arguments.Length; k++)
             {
             {
-                var kValue = arguments[k];
+                var kValue = arguments[(int)k];
                 ai.SetIndexValue(k, kValue, updateLength: k == arguments.Length - 1);
                 ai.SetIndexValue(k, kValue, updateLength: k == arguments.Length - 1);
             }
             }
         }
         }
@@ -212,7 +212,7 @@ public sealed class ArrayConstructor : Constructor
             // slower version
             // slower version
             for (uint k = 0; k < arguments.Length; k++)
             for (uint k = 0; k < arguments.Length; k++)
             {
             {
-                var kValue = arguments[k];
+                var kValue = arguments[(int)k];
                 var key = JsString.Create(k);
                 var key = JsString.Create(k);
                 a.CreateDataPropertyOrThrow(key, kValue);
                 a.CreateDataPropertyOrThrow(key, kValue);
             }
             }
@@ -223,12 +223,12 @@ public sealed class ArrayConstructor : Constructor
         return a;
         return a;
     }
     }
 
 
-    private static JsValue Species(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Species(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return thisObject;
         return thisObject;
     }
     }
 
 
-    private static JsValue IsArray(JsValue thisObject, JsValue[] arguments)
+    private static JsValue IsArray(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = arguments.At(0);
         var o = arguments.At(0);
 
 
@@ -245,17 +245,17 @@ public sealed class ArrayConstructor : Constructor
         return oi.IsArray();
         return oi.IsArray();
     }
     }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return Construct(arguments, thisObject);
         return Construct(arguments, thisObject);
     }
     }
 
 
-    public JsArray Construct(JsValue[] arguments)
+    public JsArray Construct(JsCallArguments arguments)
     {
     {
         return (JsArray) Construct(arguments, this);
         return (JsArray) Construct(arguments, this);
     }
     }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         if (newTarget.IsUndefined())
         if (newTarget.IsUndefined())
         {
         {
@@ -279,20 +279,20 @@ public sealed class ArrayConstructor : Constructor
 
 
     public JsArray Construct(int capacity)
     public JsArray Construct(int capacity)
     {
     {
-        return Construct(System.Array.Empty<JsValue>(), (uint) capacity);
+        return Construct([], (uint) capacity);
     }
     }
 
 
     public JsArray Construct(uint capacity)
     public JsArray Construct(uint capacity)
     {
     {
-        return Construct(System.Array.Empty<JsValue>(), capacity);
+        return Construct([], capacity);
     }
     }
 
 
-    public JsArray Construct(JsValue[] arguments, uint capacity)
+    public JsArray Construct(JsCallArguments arguments, uint capacity)
     {
     {
         return Construct(arguments, capacity, PrototypeObject);
         return Construct(arguments, capacity, PrototypeObject);
     }
     }
 
 
-    private JsArray Construct(JsValue[] arguments, ulong capacity, ObjectInstance prototypeObject)
+    private JsArray Construct(JsCallArguments arguments, ulong capacity, ObjectInstance prototypeObject)
     {
     {
         JsArray instance;
         JsArray instance;
         if (arguments.Length == 1)
         if (arguments.Length == 1)
@@ -367,22 +367,16 @@ public sealed class ArrayConstructor : Constructor
 
 
     public JsArray ConstructFast(JsValue[] contents)
     public JsArray ConstructFast(JsValue[] contents)
     {
     {
-        var instance = ArrayCreate((ulong) contents.Length);
-        for (var i = 0; i < contents.Length; i++)
-        {
-            instance.SetIndexValue((uint) i, contents[i], updateLength: false);
-        }
-        return instance;
+        var array = new JsValue[contents.Length];
+        System.Array.Copy(contents, array, contents.Length);
+        return new JsArray(_engine, array);
     }
     }
 
 
     internal JsArray ConstructFast(List<JsValue> contents)
     internal JsArray ConstructFast(List<JsValue> contents)
     {
     {
-        var instance = ArrayCreate((ulong) contents.Count);
-        for (var i = 0; i < contents.Count; i++)
-        {
-            instance.SetIndexValue((uint) i, contents[i], updateLength: false);
-        }
-        return instance;
+        var array = new JsValue[contents.Count];
+        contents.CopyTo(array);
+        return new JsArray(_engine, array);
     }
     }
 
 
     /// <summary>
     /// <summary>
@@ -430,7 +424,7 @@ public sealed class ArrayConstructor : Constructor
             ExceptionHelper.ThrowTypeError(_realm, $"{c} is not a constructor");
             ExceptionHelper.ThrowTypeError(_realm, $"{c} is not a constructor");
         }
         }
 
 
-        return ((IConstructor) c).Construct(new JsValue[] { JsNumber.Create(length) }, c);
+        return ((IConstructor) c).Construct([JsNumber.Create(length)], c);
     }
     }
 
 
     internal JsArray CreateArrayFromList<T>(List<T> values) where T : JsValue
     internal JsArray CreateArrayFromList<T>(List<T> values) where T : JsValue

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

@@ -27,7 +27,7 @@ public class ArrayInstance : ObjectInstance, IEnumerable<JsValue>
 
 
     private protected ArrayInstance(Engine engine, InternalTypes type) : base(engine, type: type)
     private protected ArrayInstance(Engine engine, InternalTypes type) : base(engine, type: type)
     {
     {
-        _dense = System.Array.Empty<JsValue?>();
+        _dense = [];
     }
     }
 
 
     private protected ArrayInstance(Engine engine, uint capacity = 0, uint length = 0) : base(engine, type: InternalTypes.Object | InternalTypes.Array)
     private protected ArrayInstance(Engine engine, uint capacity = 0, uint length = 0) : base(engine, type: InternalTypes.Object | InternalTypes.Array)
@@ -36,7 +36,7 @@ public class ArrayInstance : ObjectInstance, IEnumerable<JsValue>
 
 
         if (capacity < MaxDenseArrayLength)
         if (capacity < MaxDenseArrayLength)
         {
         {
-            _dense = capacity > 0 ? new JsValue?[capacity] : System.Array.Empty<JsValue?>();
+            _dense = capacity > 0 ? new JsValue?[capacity] : [];
         }
         }
         else
         else
         {
         {
@@ -1151,7 +1151,7 @@ public class ArrayInstance : ObjectInstance, IEnumerable<JsValue>
         }
         }
     }
     }
 
 
-    internal JsArray Map(JsValue[] arguments)
+    internal JsArray Map(JsCallArguments arguments)
     {
     {
         var callbackfn = arguments.At(0);
         var callbackfn = arguments.At(0);
         var thisArg = arguments.At(1);
         var thisArg = arguments.At(1);
@@ -1186,7 +1186,7 @@ public class ArrayInstance : ObjectInstance, IEnumerable<JsValue>
 
 
     /// <inheritdoc />
     /// <inheritdoc />
     internal sealed override bool FindWithCallback(
     internal sealed override bool FindWithCallback(
-        JsValue[] arguments,
+        JsCallArguments arguments,
         out ulong index,
         out ulong index,
         out JsValue value,
         out JsValue value,
         bool visitUnassigned,
         bool visitUnassigned,

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

@@ -438,7 +438,7 @@ internal abstract class ArrayOperations : IEnumerable<JsValue>
         public ArrayReadOperations(JsArray target)
         public ArrayReadOperations(JsArray target)
         {
         {
             _target = target;
             _target = target;
-            _data = target._dense ?? System.Array.Empty<JsValue>();
+            _data = target._dense ?? [];
             _length = target.Length;
             _length = target.Length;
         }
         }
 
 

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

@@ -119,7 +119,7 @@ public sealed class ArrayPrototype : ArrayInstance
         SetSymbols(symbols);
         SetSymbols(symbols);
     }
     }
 
 
-    private ObjectInstance Keys(JsValue thisObject, JsValue[] arguments)
+    private ObjectInstance Keys(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (thisObject is ObjectInstance oi && oi.IsArrayLike)
         if (thisObject is ObjectInstance oi && oi.IsArrayLike)
         {
         {
@@ -130,7 +130,7 @@ public sealed class ArrayPrototype : ArrayInstance
         return null;
         return null;
     }
     }
 
 
-    internal ObjectInstance Values(JsValue thisObject, JsValue[] arguments)
+    internal ObjectInstance Values(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (thisObject is ObjectInstance oi && oi.IsArrayLike)
         if (thisObject is ObjectInstance oi && oi.IsArrayLike)
         {
         {
@@ -141,7 +141,7 @@ public sealed class ArrayPrototype : ArrayInstance
         return null;
         return null;
     }
     }
 
 
-    private ObjectInstance With(JsValue thisObject, JsValue[] arguments)
+    private ObjectInstance With(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = ArrayOperations.For(TypeConverter.ToObject(_realm, thisObject), forWrite: false);
         var o = ArrayOperations.For(TypeConverter.ToObject(_realm, thisObject), forWrite: false);
         var len = o.GetLongLength();
         var len = o.GetLongLength();
@@ -173,7 +173,7 @@ public sealed class ArrayPrototype : ArrayInstance
         return new JsArray(_engine, a);
         return new JsArray(_engine, a);
     }
     }
 
 
-    private ObjectInstance Entries(JsValue thisObject, JsValue[] arguments)
+    private ObjectInstance Entries(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (thisObject is ObjectInstance oi && oi.IsArrayLike)
         if (thisObject is ObjectInstance oi && oi.IsArrayLike)
         {
         {
@@ -187,7 +187,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.fill
     /// https://tc39.es/ecma262/#sec-array.prototype.fill
     /// </summary>
     /// </summary>
-    private JsValue Fill(JsValue thisObject, JsValue[] arguments)
+    private JsValue Fill(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var value = arguments.At(0);
         var value = arguments.At(0);
         var start = arguments.At(1);
         var start = arguments.At(1);
@@ -240,7 +240,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.copywithin
     /// https://tc39.es/ecma262/#sec-array.prototype.copywithin
     /// </summary>
     /// </summary>
-    private JsValue CopyWithin(JsValue thisObject, JsValue[] arguments)
+    private JsValue CopyWithin(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = TypeConverter.ToObject(_realm, thisObject);
         var o = TypeConverter.ToObject(_realm, thisObject);
 
 
@@ -323,7 +323,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.lastindexof
     /// https://tc39.es/ecma262/#sec-array.prototype.lastindexof
     /// </summary>
     /// </summary>
-    private JsValue LastIndexOf(JsValue thisObject, JsValue[] arguments)
+    private JsValue LastIndexOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = ArrayOperations.For(_realm, thisObject, forWrite: false);
         var o = ArrayOperations.For(_realm, thisObject, forWrite: false);
         var len = o.GetLongLength();
         var len = o.GetLongLength();
@@ -376,7 +376,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.reduce
     /// https://tc39.es/ecma262/#sec-array.prototype.reduce
     /// </summary>
     /// </summary>
-    private JsValue Reduce(JsValue thisObject, JsValue[] arguments)
+    private JsValue Reduce(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var callbackfn = arguments.At(0);
         var callbackfn = arguments.At(0);
         var initialValue = arguments.At(1);
         var initialValue = arguments.At(1);
@@ -438,7 +438,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.filter
     /// https://tc39.es/ecma262/#sec-array.prototype.filter
     /// </summary>
     /// </summary>
-    private JsValue Filter(JsValue thisObject, JsValue[] arguments)
+    private JsValue Filter(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var callbackfn = arguments.At(0);
         var callbackfn = arguments.At(0);
         var thisArg = arguments.At(1);
         var thisArg = arguments.At(1);
@@ -478,7 +478,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.map
     /// https://tc39.es/ecma262/#sec-array.prototype.map
     /// </summary>
     /// </summary>
-    private JsValue Map(JsValue thisObject, JsValue[] arguments)
+    private JsValue Map(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (thisObject is JsArray { CanUseFastAccess: true } arrayInstance
         if (thisObject is JsArray { CanUseFastAccess: true } arrayInstance
             && !arrayInstance.HasOwnProperty(CommonProperties.Constructor))
             && !arrayInstance.HasOwnProperty(CommonProperties.Constructor))
@@ -518,7 +518,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.flat
     /// https://tc39.es/ecma262/#sec-array.prototype.flat
     /// </summary>
     /// </summary>
-    private JsValue Flat(JsValue thisObject, JsValue[] arguments)
+    private JsValue Flat(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var operations = ArrayOperations.For(_realm, thisObject, forWrite: false);
         var operations = ArrayOperations.For(_realm, thisObject, forWrite: false);
         var sourceLen = operations.GetLength();
         var sourceLen = operations.GetLength();
@@ -542,7 +542,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.flatmap
     /// https://tc39.es/ecma262/#sec-array.prototype.flatmap
     /// </summary>
     /// </summary>
-    private JsValue FlatMap(JsValue thisObject, JsValue[] arguments)
+    private JsValue FlatMap(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var O = ArrayOperations.For(_realm, thisObject, forWrite: false);
         var O = ArrayOperations.For(_realm, thisObject, forWrite: false);
         var mapperFunction = arguments.At(0);
         var mapperFunction = arguments.At(0);
@@ -634,7 +634,7 @@ public sealed class ArrayPrototype : ArrayInstance
         return targetIndex;
         return targetIndex;
     }
     }
 
 
-    private JsValue ForEach(JsValue thisObject, JsValue[] arguments)
+    private JsValue ForEach(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var callbackfn = arguments.At(0);
         var callbackfn = arguments.At(0);
         var thisArg = arguments.At(1);
         var thisArg = arguments.At(1);
@@ -663,7 +663,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.includes
     /// https://tc39.es/ecma262/#sec-array.prototype.includes
     /// </summary>
     /// </summary>
-    private JsValue Includes(JsValue thisObject, JsValue[] arguments)
+    private JsValue Includes(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = ArrayOperations.For(_realm, thisObject, forWrite: false);
         var o = ArrayOperations.For(_realm, thisObject, forWrite: false);
         var len = (long) o.GetLongLength();
         var len = (long) o.GetLongLength();
@@ -711,7 +711,7 @@ public sealed class ArrayPrototype : ArrayInstance
         return false;
         return false;
     }
     }
 
 
-    private JsValue Some(JsValue thisObject, JsValue[] arguments)
+    private JsValue Some(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var target = TypeConverter.ToObject(_realm, thisObject);
         var target = TypeConverter.ToObject(_realm, thisObject);
         return target.FindWithCallback(arguments, out _, out _, false);
         return target.FindWithCallback(arguments, out _, out _, false);
@@ -720,7 +720,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.every
     /// https://tc39.es/ecma262/#sec-array.prototype.every
     /// </summary>
     /// </summary>
-    private JsValue Every(JsValue thisObject, JsValue[] arguments)
+    private JsValue Every(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = ArrayOperations.For(_realm, thisObject, forWrite: false);
         var o = ArrayOperations.For(_realm, thisObject, forWrite: false);
         ulong len = o.GetLongLength();
         ulong len = o.GetLongLength();
@@ -757,7 +757,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.indexof
     /// https://tc39.es/ecma262/#sec-array.prototype.indexof
     /// </summary>
     /// </summary>
-    private JsValue IndexOf(JsValue thisObject, JsValue[] arguments)
+    private JsValue IndexOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = ArrayOperations.For(_realm, thisObject, forWrite: false);
         var o = ArrayOperations.For(_realm, thisObject, forWrite: false);
         var len = o.GetLongLength();
         var len = o.GetLongLength();
@@ -823,7 +823,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.find
     /// https://tc39.es/ecma262/#sec-array.prototype.find
     /// </summary>
     /// </summary>
-    private JsValue Find(JsValue thisObject, JsValue[] arguments)
+    private JsValue Find(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var target = TypeConverter.ToObject(_realm, thisObject);
         var target = TypeConverter.ToObject(_realm, thisObject);
         target.FindWithCallback(arguments, out _, out var value, visitUnassigned: true);
         target.FindWithCallback(arguments, out _, out var value, visitUnassigned: true);
@@ -833,7 +833,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.findindex
     /// https://tc39.es/ecma262/#sec-array.prototype.findindex
     /// </summary>
     /// </summary>
-    private JsValue FindIndex(JsValue thisObject, JsValue[] arguments)
+    private JsValue FindIndex(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var target = TypeConverter.ToObject(_realm, thisObject);
         var target = TypeConverter.ToObject(_realm, thisObject);
         if (target.FindWithCallback(arguments, out var index, out _, visitUnassigned: true))
         if (target.FindWithCallback(arguments, out var index, out _, visitUnassigned: true))
@@ -843,14 +843,14 @@ public sealed class ArrayPrototype : ArrayInstance
         return -1;
         return -1;
     }
     }
 
 
-    private JsValue FindLast(JsValue thisObject, JsValue[] arguments)
+    private JsValue FindLast(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var target = TypeConverter.ToObject(_realm, thisObject);
         var target = TypeConverter.ToObject(_realm, thisObject);
         target.FindWithCallback(arguments, out _, out var value, visitUnassigned: true, fromEnd: true);
         target.FindWithCallback(arguments, out _, out var value, visitUnassigned: true, fromEnd: true);
         return value;
         return value;
     }
     }
 
 
-    private JsValue FindLastIndex(JsValue thisObject, JsValue[] arguments)
+    private JsValue FindLastIndex(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var target = TypeConverter.ToObject(_realm, thisObject);
         var target = TypeConverter.ToObject(_realm, thisObject);
         if (target.FindWithCallback(arguments, out var index, out _, visitUnassigned: true, fromEnd: true))
         if (target.FindWithCallback(arguments, out var index, out _, visitUnassigned: true, fromEnd: true))
@@ -863,7 +863,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/proposal-relative-indexing-method/#sec-array-prototype-additions
     /// https://tc39.es/proposal-relative-indexing-method/#sec-array-prototype-additions
     /// </summary>
     /// </summary>
-    private JsValue At(JsValue thisObject, JsValue[] arguments)
+    private JsValue At(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var target = TypeConverter.ToObject(_realm, thisObject);
         var target = TypeConverter.ToObject(_realm, thisObject);
         var len = target.GetLength();
         var len = target.GetLength();
@@ -890,7 +890,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.splice
     /// https://tc39.es/ecma262/#sec-array.prototype.splice
     /// </summary>
     /// </summary>
-    private JsValue Splice(JsValue thisObject, JsValue[] arguments)
+    private JsValue Splice(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var start = arguments.At(0);
         var start = arguments.At(0);
         var deleteCount = arguments.At(1);
         var deleteCount = arguments.At(1);
@@ -929,7 +929,7 @@ public sealed class ArrayPrototype : ArrayInstance
             var dc = TypeConverter.ToInteger(deleteCount);
             var dc = TypeConverter.ToInteger(deleteCount);
             actualDeleteCount = (ulong) System.Math.Min(System.Math.Max(dc, 0), len - actualStart);
             actualDeleteCount = (ulong) System.Math.Min(System.Math.Max(dc, 0), len - actualStart);
 
 
-            items = System.Array.Empty<JsValue>();
+            items = [];
             if (arguments.Length > 2)
             if (arguments.Length > 2)
             {
             {
                 items = new JsValue[arguments.Length - 2];
                 items = new JsValue[arguments.Length - 2];
@@ -1010,7 +1010,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// /https://tc39.es/ecma262/#sec-array.prototype.unshift
     /// /https://tc39.es/ecma262/#sec-array.prototype.unshift
     /// </summary>
     /// </summary>
-    private JsValue Unshift(JsValue thisObject, JsValue[] arguments)
+    private JsValue Unshift(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = ArrayOperations.For(_realm, thisObject, forWrite: true);
         var o = ArrayOperations.For(_realm, thisObject, forWrite: true);
         var len = o.GetLongLength();
         var len = o.GetLongLength();
@@ -1054,7 +1054,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.sort
     /// https://tc39.es/ecma262/#sec-array.prototype.sort
     /// </summary>
     /// </summary>
-    private JsValue Sort(JsValue thisObject, JsValue[] arguments)
+    private JsValue Sort(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var obj = ArrayOperations.For(_realm, thisObject, forWrite: true);
         var obj = ArrayOperations.For(_realm, thisObject, forWrite: true);
         var compareFn = GetCompareFunction(arguments.At(0));
         var compareFn = GetCompareFunction(arguments.At(0));
@@ -1122,7 +1122,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.slice
     /// https://tc39.es/ecma262/#sec-array.prototype.slice
     /// </summary>
     /// </summary>
-    private JsValue Slice(JsValue thisObject, JsValue[] arguments)
+    private JsValue Slice(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var start = arguments.At(0);
         var start = arguments.At(0);
         var end = arguments.At(1);
         var end = arguments.At(1);
@@ -1185,7 +1185,7 @@ public sealed class ArrayPrototype : ArrayInstance
         return a;
         return a;
     }
     }
 
 
-    private JsValue Shift(JsValue thisObject, JsValue[] arg2)
+    private JsValue Shift(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = ArrayOperations.For(_realm, thisObject, forWrite: true);
         var o = ArrayOperations.For(_realm, thisObject, forWrite: true);
         var len = o.GetLength();
         var len = o.GetLength();
@@ -1218,7 +1218,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.reverse
     /// https://tc39.es/ecma262/#sec-array.prototype.reverse
     /// </summary>
     /// </summary>
-    private JsValue Reverse(JsValue thisObject, JsValue[] arguments)
+    private JsValue Reverse(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = ArrayOperations.For(_realm, thisObject, forWrite: true);
         var o = ArrayOperations.For(_realm, thisObject, forWrite: true);
         var len = o.GetLongLength();
         var len = o.GetLongLength();
@@ -1261,7 +1261,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.join
     /// https://tc39.es/ecma262/#sec-array.prototype.join
     /// </summary>
     /// </summary>
-    private JsValue Join(JsValue thisObject, JsValue[] arguments)
+    private JsValue Join(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var separator = arguments.At(0);
         var separator = arguments.At(0);
         var o = ArrayOperations.For(_realm, thisObject, forWrite: false);
         var o = ArrayOperations.For(_realm, thisObject, forWrite: false);
@@ -1312,7 +1312,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.tolocalestring
     /// https://tc39.es/ecma262/#sec-array.prototype.tolocalestring
     /// </summary>
     /// </summary>
-    private JsValue ToLocaleString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToLocaleString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         const string Separator = ",";
         const string Separator = ",";
 
 
@@ -1349,7 +1349,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.concat
     /// https://tc39.es/ecma262/#sec-array.prototype.concat
     /// </summary>
     /// </summary>
-    private JsValue Concat(JsValue thisObject, JsValue[] arguments)
+    private JsValue Concat(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = TypeConverter.ToObject(_realm, thisObject);
         var o = TypeConverter.ToObject(_realm, thisObject);
         var items = new List<JsValue>(arguments.Length + 1) { o };
         var items = new List<JsValue>(arguments.Length + 1) { o };
@@ -1400,11 +1400,11 @@ public sealed class ArrayPrototype : ArrayInstance
         return a;
         return a;
     }
     }
 
 
-    internal JsValue ToString(JsValue thisObject, JsValue[] arguments)
+    internal JsValue ToString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var array = TypeConverter.ToObject(_realm, thisObject);
         var array = TypeConverter.ToObject(_realm, thisObject);
 
 
-        Func<JsValue, JsValue[], JsValue> func;
+        JsCallDelegate func;
         if (array.Get("join") is ICallable joinFunc)
         if (array.Get("join") is ICallable joinFunc)
         {
         {
             func = joinFunc.Call;
             func = joinFunc.Call;
@@ -1417,7 +1417,7 @@ public sealed class ArrayPrototype : ArrayInstance
         return func(array, Arguments.Empty);
         return func(array, Arguments.Empty);
     }
     }
 
 
-    private JsValue ToReversed(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToReversed(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = ArrayOperations.For(_realm, thisObject, forWrite: false);
         var o = ArrayOperations.For(_realm, thisObject, forWrite: false);
 
 
@@ -1438,7 +1438,7 @@ public sealed class ArrayPrototype : ArrayInstance
         return new JsArray(_engine, a);
         return new JsArray(_engine, a);
     }
     }
 
 
-    private JsValue ToSorted(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToSorted(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = ArrayOperations.For(_realm, thisObject, forWrite: false);
         var o = ArrayOperations.For(_realm, thisObject, forWrite: false);
         var compareFn = GetCompareFunction(arguments.At(0));
         var compareFn = GetCompareFunction(arguments.At(0));
@@ -1458,7 +1458,7 @@ public sealed class ArrayPrototype : ArrayInstance
         return new JsArray(_engine, array);
         return new JsArray(_engine, array);
     }
     }
 
 
-    private JsValue ToSpliced(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToSpliced(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var start = arguments.At(0);
         var start = arguments.At(0);
         var deleteCount = arguments.At(1);
         var deleteCount = arguments.At(1);
@@ -1500,7 +1500,7 @@ public sealed class ArrayPrototype : ArrayInstance
             var dc = TypeConverter.ToIntegerOrInfinity(deleteCount);
             var dc = TypeConverter.ToIntegerOrInfinity(deleteCount);
             actualDeleteCount = (ulong) System.Math.Min(System.Math.Max(dc, 0), len - actualStart);
             actualDeleteCount = (ulong) System.Math.Min(System.Math.Max(dc, 0), len - actualStart);
 
 
-            items = System.Array.Empty<JsValue>();
+            items = [];
             if (arguments.Length > 2)
             if (arguments.Length > 2)
             {
             {
                 items = new JsValue[arguments.Length - 2];
                 items = new JsValue[arguments.Length - 2];
@@ -1578,7 +1578,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.reduceright
     /// https://tc39.es/ecma262/#sec-array.prototype.reduceright
     /// </summary>
     /// </summary>
-    private JsValue ReduceRight(JsValue thisObject, JsValue[] arguments)
+    private JsValue ReduceRight(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var callbackfn = arguments.At(0);
         var callbackfn = arguments.At(0);
         var initialValue = arguments.At(1);
         var initialValue = arguments.At(1);
@@ -1637,7 +1637,7 @@ public sealed class ArrayPrototype : ArrayInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-array.prototype.push
     /// https://tc39.es/ecma262/#sec-array.prototype.push
     /// </summary>
     /// </summary>
-    public JsValue Push(JsValue thisObject, JsValue[] arguments)
+    public JsValue Push(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (thisObject is JsArray { CanUseFastAccess: true } arrayInstance)
         if (thisObject is JsArray { CanUseFastAccess: true } arrayInstance)
         {
         {
@@ -1662,7 +1662,7 @@ public sealed class ArrayPrototype : ArrayInstance
         return n;
         return n;
     }
     }
 
 
-    public JsValue Pop(JsValue thisObject, JsValue[] arguments)
+    public JsValue Pop(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (thisObject is JsArray { CanUseFastAccess: true } array)
         if (thisObject is JsArray { CanUseFastAccess: true } array)
         {
         {

+ 3 - 3
Jint/Native/ArrayBuffer/ArrayBufferConstructor.cs

@@ -62,7 +62,7 @@ public sealed class ArrayBufferConstructor : Constructor
         return AllocateArrayBuffer(this, byteLength, maxByteLength);
         return AllocateArrayBuffer(this, byteLength, maxByteLength);
     }
     }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         if (newTarget.IsUndefined())
         if (newTarget.IsUndefined())
         {
         {
@@ -80,7 +80,7 @@ public sealed class ArrayBufferConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-get-arraybuffer-@@species
     /// https://tc39.es/ecma262/#sec-get-arraybuffer-@@species
     /// </summary>
     /// </summary>
-    private static JsValue Species(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Species(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return thisObject;
         return thisObject;
     }
     }
@@ -88,7 +88,7 @@ public sealed class ArrayBufferConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-arraybuffer.isview
     /// https://tc39.es/ecma262/#sec-arraybuffer.isview
     /// </summary>
     /// </summary>
-    private static JsValue IsView(JsValue thisObject, JsValue[] arguments)
+    private static JsValue IsView(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var arg = arguments.At(0);
         var arg = arguments.At(0);
         return arg is JsDataView or JsTypedArray;
         return arg is JsDataView or JsTypedArray;

+ 9 - 9
Jint/Native/ArrayBuffer/ArrayBufferPrototype.cs

@@ -46,7 +46,7 @@ internal sealed class ArrayBufferPrototype : Prototype
         SetSymbols(symbols);
         SetSymbols(symbols);
     }
     }
 
 
-    private JsValue Detached(JsValue thisObject, JsValue[] arguments)
+    private JsValue Detached(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject as JsArrayBuffer;
         var o = thisObject as JsArrayBuffer;
         if (o is null || o.IsSharedArrayBuffer)
         if (o is null || o.IsSharedArrayBuffer)
@@ -60,7 +60,7 @@ internal sealed class ArrayBufferPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-get-arraybuffer.prototype.maxbytelength
     /// https://tc39.es/ecma262/#sec-get-arraybuffer.prototype.maxbytelength
     /// </summary>
     /// </summary>
-    private JsValue MaxByteLength(JsValue thisObject, JsValue[] arguments)
+    private JsValue MaxByteLength(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject as JsArrayBuffer;
         var o = thisObject as JsArrayBuffer;
         if (o is null || o.IsSharedArrayBuffer)
         if (o is null || o.IsSharedArrayBuffer)
@@ -83,7 +83,7 @@ internal sealed class ArrayBufferPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-get-arraybuffer.prototype.resizable
     /// https://tc39.es/ecma262/#sec-get-arraybuffer.prototype.resizable
     /// </summary>
     /// </summary>
-    private JsValue Resizable(JsValue thisObject, JsValue[] arguments)
+    private JsValue Resizable(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject as JsArrayBuffer;
         var o = thisObject as JsArrayBuffer;
         if (o is null || o.IsSharedArrayBuffer)
         if (o is null || o.IsSharedArrayBuffer)
@@ -97,7 +97,7 @@ internal sealed class ArrayBufferPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-arraybuffer.prototype.resize
     /// https://tc39.es/ecma262/#sec-arraybuffer.prototype.resize
     /// </summary>
     /// </summary>
-    private JsValue Resize(JsValue thisObject, JsValue[] arguments)
+    private JsValue Resize(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject as JsArrayBuffer;
         var o = thisObject as JsArrayBuffer;
         if (o is null || o.IsSharedArrayBuffer)
         if (o is null || o.IsSharedArrayBuffer)
@@ -118,7 +118,7 @@ internal sealed class ArrayBufferPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-get-arraybuffer.prototype.bytelength
     /// https://tc39.es/ecma262/#sec-get-arraybuffer.prototype.bytelength
     /// </summary>
     /// </summary>
-    private JsValue ByteLength(JsValue thisObject, JsValue[] arguments)
+    private JsValue ByteLength(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject as JsArrayBuffer;
         var o = thisObject as JsArrayBuffer;
         if (o is null || o.IsSharedArrayBuffer)
         if (o is null || o.IsSharedArrayBuffer)
@@ -137,7 +137,7 @@ internal sealed class ArrayBufferPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice
     /// https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice
     /// </summary>
     /// </summary>
-    private JsValue Slice(JsValue thisObject, JsValue[] arguments)
+    private JsValue Slice(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject as JsArrayBuffer;
         var o = thisObject as JsArrayBuffer;
         if (o is null || o.IsSharedArrayBuffer)
         if (o is null || o.IsSharedArrayBuffer)
@@ -178,7 +178,7 @@ internal sealed class ArrayBufferPrototype : Prototype
 
 
         var newLen = System.Math.Max(final - first, 0);
         var newLen = System.Math.Max(final - first, 0);
         var ctor = SpeciesConstructor(o, _realm.Intrinsics.ArrayBuffer);
         var ctor = SpeciesConstructor(o, _realm.Intrinsics.ArrayBuffer);
-        var bufferInstance = Construct(ctor, new JsValue[] { JsNumber.Create(newLen) }) as JsArrayBuffer;
+        var bufferInstance = Construct(ctor, [JsNumber.Create(newLen)]) as JsArrayBuffer;
 
 
         if (bufferInstance is null)
         if (bufferInstance is null)
         {
         {
@@ -221,7 +221,7 @@ internal sealed class ArrayBufferPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfer
     /// https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfer
     /// </summary>
     /// </summary>
-    private JsValue Transfer(JsValue thisObject, JsValue[] arguments)
+    private JsValue Transfer(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return ArrayBufferCopyAndDetach(thisObject, arguments.At(0), PreserveResizability.PreserveResizability);
         return ArrayBufferCopyAndDetach(thisObject, arguments.At(0), PreserveResizability.PreserveResizability);
     }
     }
@@ -229,7 +229,7 @@ internal sealed class ArrayBufferPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfertofixedlength
     /// https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfertofixedlength
     /// </summary>
     /// </summary>
-    private JsValue TransferToFixedLength(JsValue thisObject, JsValue[] arguments)
+    private JsValue TransferToFixedLength(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return ArrayBufferCopyAndDetach(thisObject, arguments.At(0), PreserveResizability.FixedLength);
         return ArrayBufferCopyAndDetach(thisObject, arguments.At(0), PreserveResizability.FixedLength);
     }
     }

+ 2 - 2
Jint/Native/AsyncFunction/AsyncFunctionConstructor.cs

@@ -22,12 +22,12 @@ internal sealed class AsyncFunctionConstructor : Constructor
 
 
     public AsyncFunctionPrototype PrototypeObject { get; }
     public AsyncFunctionPrototype PrototypeObject { get; }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return Construct(arguments, thisObject);
         return Construct(arguments, thisObject);
     }
     }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var function = CreateDynamicFunction(
         var function = CreateDynamicFunction(
             this,
             this,

+ 2 - 2
Jint/Native/AsyncGenerator/AsyncGeneratorFunctionConstructor.cs

@@ -29,12 +29,12 @@ internal sealed class AsyncGeneratorFunctionConstructor : Constructor
 
 
     public AsyncGeneratorFunctionPrototype PrototypeObject { get; }
     public AsyncGeneratorFunctionPrototype PrototypeObject { get; }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return Construct(arguments, thisObject);
         return Construct(arguments, thisObject);
     }
     }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var function = _realm.Intrinsics.Function.CreateDynamicFunction(
         var function = _realm.Intrinsics.Function.CreateDynamicFunction(
             this,
             this,

+ 3 - 3
Jint/Native/AsyncGenerator/AsyncGeneratorPrototype.cs

@@ -47,7 +47,7 @@ internal sealed class AsyncGeneratorPrototype : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-generator.prototype.next
     /// https://tc39.es/ecma262/#sec-generator.prototype.next
     /// </summary>
     /// </summary>
-    private ObjectInstance Next(JsValue thisObject, JsValue[] arguments)
+    private ObjectInstance Next(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var g = AssertGeneratorInstance(thisObject);
         var g = AssertGeneratorInstance(thisObject);
         var value = arguments.At(0, null!);
         var value = arguments.At(0, null!);
@@ -57,7 +57,7 @@ internal sealed class AsyncGeneratorPrototype : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-generator.prototype.return
     /// https://tc39.es/ecma262/#sec-generator.prototype.return
     /// </summary>
     /// </summary>
-    private JsValue Return(JsValue thisObject, JsValue[] arguments)
+    private JsValue Return(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var g = AssertGeneratorInstance(thisObject);
         var g = AssertGeneratorInstance(thisObject);
         var value = arguments.At(0);
         var value = arguments.At(0);
@@ -68,7 +68,7 @@ internal sealed class AsyncGeneratorPrototype : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-generator.prototype.throw
     /// https://tc39.es/ecma262/#sec-generator.prototype.throw
     /// </summary>
     /// </summary>
-    private JsValue Throw(JsValue thisObject, JsValue[] arguments)
+    private JsValue Throw(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var g = AssertGeneratorInstance(thisObject);
         var g = AssertGeneratorInstance(thisObject);
         var exception = arguments.At(0);
         var exception = arguments.At(0);

+ 1 - 1
Jint/Native/Atomics/AtomicsInstance.cs

@@ -32,7 +32,7 @@ internal sealed class AtomicsInstance : ObjectInstance
         SetProperties(properties);
         SetProperties(properties);
     }
     }
 
 
-    private JsValue Pause(JsValue thisObject, JsValue[] arguments)
+    private JsValue Pause(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var iterationNumber = arguments.At(0);
         var iterationNumber = arguments.At(0);
         if (!iterationNumber.IsUndefined())
         if (!iterationNumber.IsUndefined())

+ 4 - 4
Jint/Native/BigInt/BigIntConstructor.cs

@@ -41,7 +41,7 @@ internal sealed class BigIntConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-bigint.asintn
     /// https://tc39.es/ecma262/#sec-bigint.asintn
     /// </summary>
     /// </summary>
-    private JsValue AsIntN(JsValue thisObject, JsValue[] arguments)
+    private JsValue AsIntN(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var bits = (int) TypeConverter.ToIndex(_realm, arguments.At(0));
         var bits = (int) TypeConverter.ToIndex(_realm, arguments.At(0));
         var bigint = arguments.At(1).ToBigInteger(_engine);
         var bigint = arguments.At(1).ToBigInteger(_engine);
@@ -58,7 +58,7 @@ internal sealed class BigIntConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-bigint.asuintn
     /// https://tc39.es/ecma262/#sec-bigint.asuintn
     /// </summary>
     /// </summary>
-    private JsValue AsUintN(JsValue thisObject, JsValue[] arguments)
+    private JsValue AsUintN(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var bits = (int) TypeConverter.ToIndex(_realm, arguments.At(0));
         var bits = (int) TypeConverter.ToIndex(_realm, arguments.At(0));
         var bigint = arguments.At(1).ToBigInteger(_engine);
         var bigint = arguments.At(1).ToBigInteger(_engine);
@@ -68,7 +68,7 @@ internal sealed class BigIntConstructor : Constructor
         return result;
         return result;
     }
     }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (arguments.Length == 0)
         if (arguments.Length == 0)
         {
         {
@@ -101,7 +101,7 @@ internal sealed class BigIntConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-bigint-constructor-number-value
     /// https://tc39.es/ecma262/#sec-bigint-constructor-number-value
     /// </summary>
     /// </summary>
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var value = arguments.Length > 0
         var value = arguments.Length > 0
             ? JsBigInt.Create(arguments[0].ToBigInteger(_engine))
             ? JsBigInt.Create(arguments[0].ToBigInteger(_engine))

+ 3 - 3
Jint/Native/BigInt/BigIntPrototype.cs

@@ -48,7 +48,7 @@ internal sealed class BigIntPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma402/#sup-bigint.prototype.tolocalestring
     /// https://tc39.es/ecma402/#sup-bigint.prototype.tolocalestring
     /// </summary>
     /// </summary>
-    private JsValue ToLocaleString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToLocaleString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var locales = arguments.At(0);
         var locales = arguments.At(0);
         var options = arguments.At(1);
         var options = arguments.At(1);
@@ -62,7 +62,7 @@ internal sealed class BigIntPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-bigint.prototype.valueof
     /// https://tc39.es/ecma262/#sec-bigint.prototype.valueof
     /// </summary>
     /// </summary>
-    private JsValue ValueOf(JsValue thisObject, JsValue[] arguments)
+    private JsValue ValueOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (thisObject is BigIntInstance ni)
         if (thisObject is BigIntInstance ni)
         {
         {
@@ -81,7 +81,7 @@ internal sealed class BigIntPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-bigint.prototype.tostring
     /// https://tc39.es/ecma262/#sec-bigint.prototype.tostring
     /// </summary>
     /// </summary>
-    private JsValue ToBigIntString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToBigIntString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = ThisBigIntValue(thisObject);
         var x = ThisBigIntValue(thisObject);
 
 

+ 2 - 2
Jint/Native/Boolean/BooleanConstructor.cs

@@ -24,7 +24,7 @@ internal sealed class BooleanConstructor : Constructor
 
 
     public BooleanPrototype PrototypeObject { get; }
     public BooleanPrototype PrototypeObject { get; }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (arguments.Length == 0)
         if (arguments.Length == 0)
         {
         {
@@ -37,7 +37,7 @@ internal sealed class BooleanConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-boolean-constructor-boolean-value
     /// https://tc39.es/ecma262/#sec-boolean-constructor-boolean-value
     /// </summary>
     /// </summary>
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var b = TypeConverter.ToBoolean(arguments.At(0))
         var b = TypeConverter.ToBoolean(arguments.At(0))
             ? JsBoolean.True
             ? JsBoolean.True

+ 2 - 2
Jint/Native/Boolean/BooleanPrototype.cs

@@ -36,7 +36,7 @@ internal sealed class BooleanPrototype : BooleanInstance
         SetProperties(properties);
         SetProperties(properties);
     }
     }
 
 
-    private JsValue ValueOf(JsValue thisObject, JsValue[] arguments)
+    private JsValue ValueOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (thisObject._type == InternalTypes.Boolean)
         if (thisObject._type == InternalTypes.Boolean)
         {
         {
@@ -52,7 +52,7 @@ internal sealed class BooleanPrototype : BooleanInstance
         return Undefined;
         return Undefined;
     }
     }
 
 
-    private JsString ToBooleanString(JsValue thisObject, JsValue[] arguments)
+    private JsString ToBooleanString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var b = ValueOf(thisObject, Arguments.Empty);
         var b = ValueOf(thisObject, Arguments.Empty);
         return ((JsBoolean) b)._value ? JsString.TrueString : JsString.FalseString;
         return ((JsBoolean) b)._value ? JsString.TrueString : JsString.FalseString;

+ 2 - 2
Jint/Native/Constructor.cs

@@ -13,11 +13,11 @@ public abstract class Constructor : Function.Function, IConstructor
     {
     {
     }
     }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         ExceptionHelper.ThrowTypeError(_realm, $"Constructor {_nameDescriptor?.Value} requires 'new'");
         ExceptionHelper.ThrowTypeError(_realm, $"Constructor {_nameDescriptor?.Value} requires 'new'");
         return null;
         return null;
     }
     }
 
 
-    public abstract ObjectInstance Construct(JsValue[] arguments, JsValue newTarget);
+    public abstract ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget);
 }
 }

+ 1 - 1
Jint/Native/DataView/DataViewConstructor.cs

@@ -27,7 +27,7 @@ internal sealed class DataViewConstructor : Constructor
 
 
     private DataViewPrototype PrototypeObject { get; }
     private DataViewPrototype PrototypeObject { get; }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         if (newTarget.IsUndefined())
         if (newTarget.IsUndefined())
         {
         {

+ 25 - 25
Jint/Native/DataView/DataViewPrototype.cs

@@ -69,7 +69,7 @@ internal sealed class DataViewPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-get-dataview.prototype.buffer
     /// https://tc39.es/ecma262/#sec-get-dataview.prototype.buffer
     /// </summary>
     /// </summary>
-    private JsValue Buffer(JsValue thisObject, JsValue[] arguments)
+    private JsValue Buffer(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject as JsDataView;
         var o = thisObject as JsDataView;
         if (o is null)
         if (o is null)
@@ -83,7 +83,7 @@ internal sealed class DataViewPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-get-dataview.prototype.bytelength
     /// https://tc39.es/ecma262/#sec-get-dataview.prototype.bytelength
     /// </summary>
     /// </summary>
-    private JsValue ByteLength(JsValue thisObject, JsValue[] arguments)
+    private JsValue ByteLength(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject as JsDataView;
         var o = thisObject as JsDataView;
         if (o is null)
         if (o is null)
@@ -106,7 +106,7 @@ internal sealed class DataViewPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-get-dataview.prototype.byteoffset
     /// https://tc39.es/ecma262/#sec-get-dataview.prototype.byteoffset
     /// </summary>
     /// </summary>
-    private JsValue ByteOffset(JsValue thisObject, JsValue[] arguments)
+    private JsValue ByteOffset(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject as JsDataView;
         var o = thisObject as JsDataView;
         if (o is null)
         if (o is null)
@@ -126,112 +126,112 @@ internal sealed class DataViewPrototype : Prototype
         return JsNumber.Create(o._byteOffset);
         return JsNumber.Create(o._byteOffset);
     }
     }
 
 
-    private JsValue GetBigInt64(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetBigInt64(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1), TypedArrayElementType.BigInt64);
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1), TypedArrayElementType.BigInt64);
     }
     }
 
 
-    private JsValue GetBigUint64(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetBigUint64(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1), TypedArrayElementType.BigUint64);
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1), TypedArrayElementType.BigUint64);
     }
     }
 
 
-    private JsValue GetFloat16(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetFloat16(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1, JsBoolean.False), TypedArrayElementType.Float16);
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1, JsBoolean.False), TypedArrayElementType.Float16);
     }
     }
 
 
-    private JsValue GetFloat32(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetFloat32(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1, JsBoolean.False), TypedArrayElementType.Float32);
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1, JsBoolean.False), TypedArrayElementType.Float32);
     }
     }
 
 
-    private JsValue GetFloat64(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetFloat64(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1, JsBoolean.False), TypedArrayElementType.Float64);
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1, JsBoolean.False), TypedArrayElementType.Float64);
     }
     }
 
 
-    private JsValue GetInt8(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetInt8(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return GetViewValue(thisObject, arguments.At(0), JsBoolean.True, TypedArrayElementType.Int8);
         return GetViewValue(thisObject, arguments.At(0), JsBoolean.True, TypedArrayElementType.Int8);
     }
     }
 
 
-    private JsValue GetInt16(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetInt16(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1, JsBoolean.False), TypedArrayElementType.Int16);
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1, JsBoolean.False), TypedArrayElementType.Int16);
     }
     }
 
 
-    private JsValue GetInt32(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetInt32(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1, JsBoolean.False), TypedArrayElementType.Int32);
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1, JsBoolean.False), TypedArrayElementType.Int32);
     }
     }
 
 
-    private JsValue GetUint8(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetUint8(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return GetViewValue(thisObject, arguments.At(0), JsBoolean.True, TypedArrayElementType.Uint8);
         return GetViewValue(thisObject, arguments.At(0), JsBoolean.True, TypedArrayElementType.Uint8);
     }
     }
 
 
-    private JsValue GetUint16(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetUint16(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1, JsBoolean.False), TypedArrayElementType.Uint16);
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1, JsBoolean.False), TypedArrayElementType.Uint16);
     }
     }
 
 
-    private JsValue GetUint32(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetUint32(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1, JsBoolean.False), TypedArrayElementType.Uint32);
         return GetViewValue(thisObject, arguments.At(0), arguments.At(1, JsBoolean.False), TypedArrayElementType.Uint32);
     }
     }
 
 
-    private JsValue SetBigInt64(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetBigInt64(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2), TypedArrayElementType.BigInt64, arguments.At(1));
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2), TypedArrayElementType.BigInt64, arguments.At(1));
     }
     }
 
 
-    private JsValue SetBigUint64(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetBigUint64(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2), TypedArrayElementType.BigUint64, arguments.At(1));
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2), TypedArrayElementType.BigUint64, arguments.At(1));
     }
     }
 
 
-    private JsValue SetFloat16(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetFloat16(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2, JsBoolean.False), TypedArrayElementType.Float16, arguments.At(1));
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2, JsBoolean.False), TypedArrayElementType.Float16, arguments.At(1));
     }
     }
 
 
-    private JsValue SetFloat32(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetFloat32(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2, JsBoolean.False), TypedArrayElementType.Float32, arguments.At(1));
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2, JsBoolean.False), TypedArrayElementType.Float32, arguments.At(1));
     }
     }
 
 
-    private JsValue SetFloat64(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetFloat64(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2, JsBoolean.False), TypedArrayElementType.Float64, arguments.At(1));
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2, JsBoolean.False), TypedArrayElementType.Float64, arguments.At(1));
     }
     }
 
 
-    private JsValue SetInt8(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetInt8(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return SetViewValue(thisObject, arguments.At(0), JsBoolean.True, TypedArrayElementType.Int8, arguments.At(1));
         return SetViewValue(thisObject, arguments.At(0), JsBoolean.True, TypedArrayElementType.Int8, arguments.At(1));
     }
     }
 
 
-    private JsValue SetInt16(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetInt16(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2, JsBoolean.False), TypedArrayElementType.Int16, arguments.At(1));
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2, JsBoolean.False), TypedArrayElementType.Int16, arguments.At(1));
     }
     }
 
 
-    private JsValue SetInt32(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetInt32(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2, JsBoolean.False), TypedArrayElementType.Int32, arguments.At(1));
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2, JsBoolean.False), TypedArrayElementType.Int32, arguments.At(1));
     }
     }
 
 
-    private JsValue SetUint8(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetUint8(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return SetViewValue(thisObject, arguments.At(0), JsBoolean.True, TypedArrayElementType.Uint8, arguments.At(1));
         return SetViewValue(thisObject, arguments.At(0), JsBoolean.True, TypedArrayElementType.Uint8, arguments.At(1));
     }
     }
 
 
-    private JsValue SetUint16(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetUint16(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2, JsBoolean.False), TypedArrayElementType.Uint16, arguments.At(1));
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2, JsBoolean.False), TypedArrayElementType.Uint16, arguments.At(1));
     }
     }
 
 
-    private JsValue SetUint32(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetUint32(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2, JsBoolean.False), TypedArrayElementType.Uint32, arguments.At(1));
         return SetViewValue(thisObject, arguments.At(0), arguments.At(2, JsBoolean.False), TypedArrayElementType.Uint32, arguments.At(1));
     }
     }

+ 6 - 6
Jint/Native/Date/DateConstructor.cs

@@ -51,7 +51,7 @@ internal sealed class DateConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.parse
     /// https://tc39.es/ecma262/#sec-date.parse
     /// </summary>
     /// </summary>
-    private JsValue Parse(JsValue thisObject, JsValue[] arguments)
+    private JsValue Parse(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var dateString = TypeConverter.ToString(arguments.At(0));
         var dateString = TypeConverter.ToString(arguments.At(0));
         var date = ParseFromString(dateString);
         var date = ParseFromString(dateString);
@@ -75,7 +75,7 @@ internal sealed class DateConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.utc
     /// https://tc39.es/ecma262/#sec-date.utc
     /// </summary>
     /// </summary>
-    private static JsValue Utc(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Utc(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var y = TypeConverter.ToNumber(arguments.At(0));
         var y = TypeConverter.ToNumber(arguments.At(0));
         var m = TypeConverter.ToNumber(arguments.At(1, JsNumber.PositiveZero));
         var m = TypeConverter.ToNumber(arguments.At(1, JsNumber.PositiveZero));
@@ -98,12 +98,12 @@ internal sealed class DateConstructor : Constructor
         return finalDate.TimeClip().ToJsValue();
         return finalDate.TimeClip().ToJsValue();
     }
     }
 
 
-    private JsValue Now(JsValue thisObject, JsValue[] arguments)
+    private JsValue Now(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return (long) (_timeSystem.GetUtcNow().DateTime - Epoch).TotalMilliseconds;
         return (long) (_timeSystem.GetUtcNow().DateTime - Epoch).TotalMilliseconds;
     }
     }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return PrototypeObject.ToString(Construct(Arguments.Empty, thisObject), Arguments.Empty);
         return PrototypeObject.ToString(Construct(Arguments.Empty, thisObject), Arguments.Empty);
     }
     }
@@ -111,7 +111,7 @@ internal sealed class DateConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date
     /// https://tc39.es/ecma262/#sec-date
     /// </summary>
     /// </summary>
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         // fast path is building default, new Date()
         // fast path is building default, new Date()
         if (arguments.Length == 0 || newTarget.IsUndefined())
         if (arguments.Length == 0 || newTarget.IsUndefined())
@@ -126,7 +126,7 @@ internal sealed class DateConstructor : Constructor
         return ConstructUnlikely(arguments, newTarget);
         return ConstructUnlikely(arguments, newTarget);
     }
     }
 
 
-    private JsDate ConstructUnlikely(JsValue[] arguments, JsValue newTarget)
+    private JsDate ConstructUnlikely(JsCallArguments arguments, JsValue newTarget)
     {
     {
         DatePresentation dv;
         DatePresentation dv;
         if (arguments.Length == 1)
         if (arguments.Length == 1)

+ 53 - 53
Jint/Native/Date/DatePrototype.cs

@@ -103,7 +103,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive
     /// https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive
     /// </summary>
     /// </summary>
-    private JsValue ToPrimitive(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToPrimitive(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var oi = thisObject as ObjectInstance;
         var oi = thisObject as ObjectInstance;
         if (oi is null)
         if (oi is null)
@@ -135,7 +135,7 @@ internal sealed class DatePrototype : Prototype
         return TypeConverter.OrdinaryToPrimitive(oi, tryFirst);
         return TypeConverter.OrdinaryToPrimitive(oi, tryFirst);
     }
     }
 
 
-    private JsValue ValueOf(JsValue thisObject, JsValue[] arguments)
+    private JsValue ValueOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return ThisTimeValue(thisObject).ToJsValue();
         return ThisTimeValue(thisObject).ToJsValue();
     }
     }
@@ -157,7 +157,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.tostring
     /// https://tc39.es/ecma262/#sec-date.prototype.tostring
     /// </summary>
     /// </summary>
-    internal JsValue ToString(JsValue thisObject, JsValue[] arg2)
+    internal JsValue ToString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var tv = ThisTimeValue(thisObject);
         var tv = ThisTimeValue(thisObject);
         return ToDateString(tv);
         return ToDateString(tv);
@@ -166,7 +166,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.todatestring
     /// https://tc39.es/ecma262/#sec-date.prototype.todatestring
     /// </summary>
     /// </summary>
-    private JsValue ToDateString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToDateString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var tv = ThisTimeValue(thisObject);
         var tv = ThisTimeValue(thisObject);
 
 
@@ -196,7 +196,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.totimestring
     /// https://tc39.es/ecma262/#sec-date.prototype.totimestring
     /// </summary>
     /// </summary>
-    private JsValue ToTimeString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToTimeString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var tv = ThisTimeValue(thisObject);
         var tv = ThisTimeValue(thisObject);
 
 
@@ -213,7 +213,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.tolocalestring
     /// https://tc39.es/ecma262/#sec-date.prototype.tolocalestring
     /// </summary>
     /// </summary>
-    private JsValue ToLocaleString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToLocaleString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var dateInstance = ThisTimeValue(thisObject);
         var dateInstance = ThisTimeValue(thisObject);
 
 
@@ -228,7 +228,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.tolocaledatestring
     /// https://tc39.es/ecma262/#sec-date.prototype.tolocaledatestring
     /// </summary>
     /// </summary>
-    private JsValue ToLocaleDateString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToLocaleDateString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var dateInstance = ThisTimeValue(thisObject);
         var dateInstance = ThisTimeValue(thisObject);
 
 
@@ -243,7 +243,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.tolocaletimestring
     /// https://tc39.es/ecma262/#sec-date.prototype.tolocaletimestring
     /// </summary>
     /// </summary>
-    private JsValue ToLocaleTimeString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToLocaleTimeString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var dateInstance = ThisTimeValue(thisObject);
         var dateInstance = ThisTimeValue(thisObject);
 
 
@@ -255,7 +255,7 @@ internal sealed class DatePrototype : Prototype
         return ToLocalTime(dateInstance).ToString("T", Engine.Options.Culture);
         return ToLocalTime(dateInstance).ToString("T", Engine.Options.Culture);
     }
     }
 
 
-    private JsValue GetTime(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetTime(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -265,7 +265,7 @@ internal sealed class DatePrototype : Prototype
         return t.ToJsValue();
         return t.ToJsValue();
     }
     }
 
 
-    private JsValue GetFullYear(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetFullYear(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -275,7 +275,7 @@ internal sealed class DatePrototype : Prototype
         return YearFromTime(LocalTime(t));
         return YearFromTime(LocalTime(t));
     }
     }
 
 
-    private JsValue GetYear(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetYear(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -285,7 +285,7 @@ internal sealed class DatePrototype : Prototype
         return YearFromTime(LocalTime(t)) - 1900;
         return YearFromTime(LocalTime(t)) - 1900;
     }
     }
 
 
-    private JsValue GetUTCFullYear(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetUTCFullYear(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -295,7 +295,7 @@ internal sealed class DatePrototype : Prototype
         return YearFromTime(t);
         return YearFromTime(t);
     }
     }
 
 
-    private JsValue GetMonth(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetMonth(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -308,7 +308,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.getutcmonth
     /// https://tc39.es/ecma262/#sec-date.prototype.getutcmonth
     /// </summary>
     /// </summary>
-    private JsValue GetUTCMonth(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetUTCMonth(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -321,7 +321,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.getdate
     /// https://tc39.es/ecma262/#sec-date.prototype.getdate
     /// </summary>
     /// </summary>
-    private JsValue GetDate(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetDate(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -331,7 +331,7 @@ internal sealed class DatePrototype : Prototype
         return DateFromTime(LocalTime(t));
         return DateFromTime(LocalTime(t));
     }
     }
 
 
-    private JsValue GetUTCDate(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetUTCDate(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -341,7 +341,7 @@ internal sealed class DatePrototype : Prototype
         return DateFromTime(t);
         return DateFromTime(t);
     }
     }
 
 
-    private JsValue GetDay(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetDay(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -351,7 +351,7 @@ internal sealed class DatePrototype : Prototype
         return WeekDay(LocalTime(t));
         return WeekDay(LocalTime(t));
     }
     }
 
 
-    private JsValue GetUTCDay(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetUTCDay(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -361,7 +361,7 @@ internal sealed class DatePrototype : Prototype
         return WeekDay(t);
         return WeekDay(t);
     }
     }
 
 
-    private JsValue GetHours(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetHours(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -371,7 +371,7 @@ internal sealed class DatePrototype : Prototype
         return HourFromTime(LocalTime(t));
         return HourFromTime(LocalTime(t));
     }
     }
 
 
-    private JsValue GetUTCHours(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetUTCHours(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -381,7 +381,7 @@ internal sealed class DatePrototype : Prototype
         return HourFromTime(t);
         return HourFromTime(t);
     }
     }
 
 
-    private JsValue GetMinutes(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetMinutes(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -391,7 +391,7 @@ internal sealed class DatePrototype : Prototype
         return MinFromTime(LocalTime(t));
         return MinFromTime(LocalTime(t));
     }
     }
 
 
-    private JsValue GetUTCMinutes(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetUTCMinutes(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -401,7 +401,7 @@ internal sealed class DatePrototype : Prototype
         return MinFromTime(t);
         return MinFromTime(t);
     }
     }
 
 
-    private JsValue GetSeconds(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetSeconds(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -411,7 +411,7 @@ internal sealed class DatePrototype : Prototype
         return SecFromTime(LocalTime(t));
         return SecFromTime(LocalTime(t));
     }
     }
 
 
-    private JsValue GetUTCSeconds(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetUTCSeconds(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -421,7 +421,7 @@ internal sealed class DatePrototype : Prototype
         return SecFromTime(t);
         return SecFromTime(t);
     }
     }
 
 
-    private JsValue GetMilliseconds(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetMilliseconds(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -431,7 +431,7 @@ internal sealed class DatePrototype : Prototype
         return MsFromTime(LocalTime(t));
         return MsFromTime(LocalTime(t));
     }
     }
 
 
-    private JsValue GetUTCMilliseconds(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetUTCMilliseconds(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -441,7 +441,7 @@ internal sealed class DatePrototype : Prototype
         return MsFromTime(t);
         return MsFromTime(t);
     }
     }
 
 
-    private JsValue GetTimezoneOffset(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetTimezoneOffset(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         if (t.IsNaN)
         if (t.IsNaN)
@@ -454,7 +454,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.settime
     /// https://tc39.es/ecma262/#sec-date.prototype.settime
     /// </summary>
     /// </summary>
-    private JsValue SetTime(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetTime(JsValue thisObject, JsCallArguments arguments)
     {
     {
         ThisTimeValue(thisObject);
         ThisTimeValue(thisObject);
         var t = TypeConverter.ToNumber(arguments.At(0));
         var t = TypeConverter.ToNumber(arguments.At(0));
@@ -467,7 +467,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.setmilliseconds
     /// https://tc39.es/ecma262/#sec-date.prototype.setmilliseconds
     /// </summary>
     /// </summary>
-    private JsValue SetMilliseconds(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetMilliseconds(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = LocalTime(ThisTimeValue(thisObject));
         var t = LocalTime(ThisTimeValue(thisObject));
         var ms = TypeConverter.ToNumber(arguments.At(0));
         var ms = TypeConverter.ToNumber(arguments.At(0));
@@ -486,7 +486,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.setutcmilliseconds
     /// https://tc39.es/ecma262/#sec-date.prototype.setutcmilliseconds
     /// </summary>
     /// </summary>
-    private JsValue SetUTCMilliseconds(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetUTCMilliseconds(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         var milli = TypeConverter.ToNumber(arguments.At(0));
         var milli = TypeConverter.ToNumber(arguments.At(0));
@@ -505,7 +505,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.setseconds
     /// https://tc39.es/ecma262/#sec-date.prototype.setseconds
     /// </summary>
     /// </summary>
-    private JsValue SetSeconds(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetSeconds(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = LocalTime(ThisTimeValue(thisObject));
         var t = LocalTime(ThisTimeValue(thisObject));
         var s = TypeConverter.ToNumber(arguments.At(0));
         var s = TypeConverter.ToNumber(arguments.At(0));
@@ -525,7 +525,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.setutcseconds
     /// https://tc39.es/ecma262/#sec-date.prototype.setutcseconds
     /// </summary>
     /// </summary>
-    private JsValue SetUTCSeconds(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetUTCSeconds(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         var s = TypeConverter.ToNumber(arguments.At(0));
         var s = TypeConverter.ToNumber(arguments.At(0));
@@ -545,7 +545,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.setminutes
     /// https://tc39.es/ecma262/#sec-date.prototype.setminutes
     /// </summary>
     /// </summary>
-    private JsValue SetMinutes(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetMinutes(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = LocalTime(ThisTimeValue(thisObject));
         var t = LocalTime(ThisTimeValue(thisObject));
         var m = TypeConverter.ToNumber(arguments.At(0));
         var m = TypeConverter.ToNumber(arguments.At(0));
@@ -566,7 +566,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.setutcminutes
     /// https://tc39.es/ecma262/#sec-date.prototype.setutcminutes
     /// </summary>
     /// </summary>
-    private JsValue SetUTCMinutes(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetUTCMinutes(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         var m = TypeConverter.ToNumber(arguments.At(0));
         var m = TypeConverter.ToNumber(arguments.At(0));
@@ -587,7 +587,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.sethours
     /// https://tc39.es/ecma262/#sec-date.prototype.sethours
     /// </summary>
     /// </summary>
-    private JsValue SetHours(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetHours(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = LocalTime(ThisTimeValue(thisObject));
         var t = LocalTime(ThisTimeValue(thisObject));
         var h = TypeConverter.ToNumber(arguments.At(0));
         var h = TypeConverter.ToNumber(arguments.At(0));
@@ -609,7 +609,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.setutchours
     /// https://tc39.es/ecma262/#sec-date.prototype.setutchours
     /// </summary>
     /// </summary>
-    private JsValue SetUTCHours(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetUTCHours(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         var h = TypeConverter.ToNumber(arguments.At(0));
         var h = TypeConverter.ToNumber(arguments.At(0));
@@ -631,7 +631,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.setdate
     /// https://tc39.es/ecma262/#sec-date.prototype.setdate
     /// </summary>
     /// </summary>
-    private JsValue SetDate(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetDate(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = LocalTime(ThisTimeValue(thisObject));
         var t = LocalTime(ThisTimeValue(thisObject));
         var dt = TypeConverter.ToNumber(arguments.At(0));
         var dt = TypeConverter.ToNumber(arguments.At(0));
@@ -651,7 +651,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.setutcdate
     /// https://tc39.es/ecma262/#sec-date.prototype.setutcdate
     /// </summary>
     /// </summary>
-    private JsValue SetUTCDate(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetUTCDate(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         var dt = TypeConverter.ToNumber(arguments.At(0));
         var dt = TypeConverter.ToNumber(arguments.At(0));
@@ -670,7 +670,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.setmonth
     /// https://tc39.es/ecma262/#sec-date.prototype.setmonth
     /// </summary>
     /// </summary>
-    private JsValue SetMonth(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetMonth(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = LocalTime(ThisTimeValue(thisObject));
         var t = LocalTime(ThisTimeValue(thisObject));
         var m = TypeConverter.ToNumber(arguments.At(0));
         var m = TypeConverter.ToNumber(arguments.At(0));
@@ -690,7 +690,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.setutcmonth
     /// https://tc39.es/ecma262/#sec-date.prototype.setutcmonth
     /// </summary>
     /// </summary>
-    private JsValue SetUTCMonth(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetUTCMonth(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var t = ThisTimeValue(thisObject);
         var t = ThisTimeValue(thisObject);
         var m = TypeConverter.ToNumber(arguments.At(0));
         var m = TypeConverter.ToNumber(arguments.At(0));
@@ -710,7 +710,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.setfullyear
     /// https://tc39.es/ecma262/#sec-date.prototype.setfullyear
     /// </summary>
     /// </summary>
-    private JsValue SetFullYear(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetFullYear(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var thisTime = ThisTimeValue(thisObject);
         var thisTime = ThisTimeValue(thisObject);
         var t = thisTime.IsNaN ? 0 : LocalTime(thisTime);
         var t = thisTime.IsNaN ? 0 : LocalTime(thisTime);
@@ -727,7 +727,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.setyear
     /// https://tc39.es/ecma262/#sec-date.prototype.setyear
     /// </summary>
     /// </summary>
-    private JsValue SetYear(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetYear(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var thisTime = ThisTimeValue(thisObject);
         var thisTime = ThisTimeValue(thisObject);
         var t = thisTime.IsNaN ? 0 : LocalTime(thisTime);
         var t = thisTime.IsNaN ? 0 : LocalTime(thisTime);
@@ -753,7 +753,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.setutcfullyear
     /// https://tc39.es/ecma262/#sec-date.prototype.setutcfullyear
     /// </summary>
     /// </summary>
-    private JsValue SetUTCFullYear(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetUTCFullYear(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var thisTime = ThisTimeValue(thisObject);
         var thisTime = ThisTimeValue(thisObject);
         var t = thisTime.IsNaN ? 0 : thisTime;
         var t = thisTime.IsNaN ? 0 : thisTime;
@@ -769,7 +769,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.toutcstring
     /// https://tc39.es/ecma262/#sec-date.prototype.toutcstring
     /// </summary>
     /// </summary>
-    private JsValue ToUtcString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToUtcString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var tv = ThisTimeValue(thisObject);
         var tv = ThisTimeValue(thisObject);
         if (!IsFinite(tv))
         if (!IsFinite(tv))
@@ -789,7 +789,7 @@ internal sealed class DatePrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-date.prototype.toisostring
     /// https://tc39.es/ecma262/#sec-date.prototype.toisostring
     /// </summary>
     /// </summary>
-    private JsValue ToISOString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToISOString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var thisTime = ThisTimeValue(thisObject);
         var thisTime = ThisTimeValue(thisObject);
         var t = thisTime;
         var t = thisTime;
@@ -826,7 +826,7 @@ internal sealed class DatePrototype : Prototype
         return formatted;
         return formatted;
     }
     }
 
 
-    private JsValue ToJson(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToJson(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = TypeConverter.ToObject(_realm, thisObject);
         var o = TypeConverter.ToObject(_realm, thisObject);
         var tv = TypeConverter.ToPrimitive(o, Types.Number);
         var tv = TypeConverter.ToPrimitive(o, Types.Number);
@@ -1191,8 +1191,8 @@ internal sealed class DatePrototype : Prototype
         return t;
         return t;
     }
     }
 
 
-    private static readonly int[] _dayFromMonth = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
-    private static readonly int[] _dayFromMonthLeapYear = { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 };
+    private static readonly int[] _dayFromMonth = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
+    private static readonly int[] _dayFromMonthLeapYear = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
 
 
     internal static double MakeDay(double year, double month, double date)
     internal static double MakeDay(double year, double month, double date)
     {
     {
@@ -1268,7 +1268,7 @@ internal sealed class DatePrototype : Prototype
     [StructLayout(LayoutKind.Auto)]
     [StructLayout(LayoutKind.Auto)]
     private readonly record struct Date(int Year, int Month, int Day);
     private readonly record struct Date(int Year, int Month, int Day);
 
 
-    private static readonly int[] kDaysInMonths = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+    private static readonly int[] kDaysInMonths = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
 
 
     private static Date YearMonthDayFromTime(DatePresentation t) => YearMonthDayFromDays((long) System.Math.Floor(t.Value / 1000 / 60 / 60 / 24d));
     private static Date YearMonthDayFromTime(DatePresentation t) => YearMonthDayFromDays((long) System.Math.Floor(t.Value / 1000 / 60 / 60 / 24d));
 
 
@@ -1342,14 +1342,14 @@ internal sealed class DatePrototype : Prototype
     }
     }
 
 
     private static readonly string[] _dayNames =
     private static readonly string[] _dayNames =
-    {
+    [
         "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
         "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
-    };
+    ];
 
 
     private static readonly string[] _monthNames =
     private static readonly string[] _monthNames =
-    {
+    [
         "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
         "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
-    };
+    ];
 
 
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-datestring
     /// https://tc39.es/ecma262/#sec-datestring

+ 2 - 2
Jint/Native/Date/MimeKit.cs

@@ -115,9 +115,9 @@ internal static class DateUtils
     private const string NumericCharacters = "0123456789";
     private const string NumericCharacters = "0123456789";
     private const string TimeCharacters = "0123456789:";
     private const string TimeCharacters = "0123456789:";
 
 
-    private static readonly string[] Months = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+    private static readonly string[] Months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
 
 
-    private static readonly string[] WeekDays = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
+    private static readonly string[] WeekDays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
 
 
     private static readonly Dictionary<string, int> timezones;
     private static readonly Dictionary<string, int> timezones;
     private static readonly DateTokenFlags[] datetok;
     private static readonly DateTokenFlags[] datetok;

+ 4 - 4
Jint/Native/Error/ErrorConstructor.cs

@@ -36,20 +36,20 @@ public sealed class ErrorConstructor : Constructor
         SetProperties(properties);
         SetProperties(properties);
     }
     }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return Construct(arguments, this);
         return Construct(arguments, this);
     }
     }
 
 
     public ObjectInstance Construct(string? message = null)
     public ObjectInstance Construct(string? message = null)
     {
     {
-        return Construct(message != null ? new JsValue[] { message } : System.Array.Empty<JsValue>(), this);
+        return Construct(message != null ? [message] : [], this);
     }
     }
 
 
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-nativeerror
     /// https://tc39.es/ecma262/#sec-nativeerror
     /// </summary>
     /// </summary>
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var o = OrdinaryCreateFromConstructor(
         var o = OrdinaryCreateFromConstructor(
             newTarget,
             newTarget,
@@ -98,7 +98,7 @@ public sealed class ErrorConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/proposal-is-error/
     /// https://tc39.es/proposal-is-error/
     /// </summary>
     /// </summary>
-    private static JsValue IsError(JsValue? thisObj, JsValue[] arguments)
+    private static JsValue IsError(JsValue? thisObj, JsCallArguments arguments)
     {
     {
         return arguments.At(0) is JsError;
         return arguments.At(0) is JsError;
     }
     }

+ 1 - 1
Jint/Native/Error/ErrorPrototype.cs

@@ -41,7 +41,7 @@ internal sealed class ErrorPrototype : ErrorInstance
         SetProperties(properties);
         SetProperties(properties);
     }
     }
 
 
-    public JsValue ToString(JsValue thisObject, JsValue[] arguments)
+    public JsValue ToString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject.TryCast<ObjectInstance>();
         var o = thisObject.TryCast<ObjectInstance>();
         if (o is null)
         if (o is null)

+ 2 - 2
Jint/Native/FinalizationRegistry/FinalizationRegistryConstructor.cs

@@ -26,12 +26,12 @@ internal sealed class FinalizationRegistryConstructor : Constructor
 
 
     public FinalizationRegistryPrototype PrototypeObject { get; }
     public FinalizationRegistryPrototype PrototypeObject { get; }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return Construct(arguments, thisObject);
         return Construct(arguments, thisObject);
     }
     }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         if (newTarget.IsUndefined())
         if (newTarget.IsUndefined())
         {
         {

+ 2 - 2
Jint/Native/FinalizationRegistry/FinalizationRegistryPrototype.cs

@@ -42,7 +42,7 @@ internal sealed class FinalizationRegistryPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-finalization-registry.prototype.register
     /// https://tc39.es/ecma262/#sec-finalization-registry.prototype.register
     /// </summary>
     /// </summary>
-    private JsValue Register(JsValue thisObject, JsValue[] arguments)
+    private JsValue Register(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var finalizationRegistry = AssertFinalizationRegistryInstance(thisObject);
         var finalizationRegistry = AssertFinalizationRegistryInstance(thisObject);
 
 
@@ -76,7 +76,7 @@ internal sealed class FinalizationRegistryPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-finalization-registry.prototype.unregister
     /// https://tc39.es/ecma262/#sec-finalization-registry.prototype.unregister
     /// </summary>
     /// </summary>
-    private JsValue Unregister(JsValue thisObject, JsValue[] arguments)
+    private JsValue Unregister(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var finalizationRegistry = AssertFinalizationRegistryInstance(thisObject);
         var finalizationRegistry = AssertFinalizationRegistryInstance(thisObject);
 
 

+ 3 - 3
Jint/Native/Function/BindFunction.cs

@@ -40,7 +40,7 @@ public sealed class BindFunction : ObjectInstance, IConstructor, ICallable
     /// </summary>
     /// </summary>
     public JsValue[] BoundArguments { get; }
     public JsValue[] BoundArguments { get; }
 
 
-    JsValue ICallable.Call(JsValue thisObject, JsValue[] arguments)
+    JsValue ICallable.Call(JsValue thisObject, params JsCallArguments arguments)
     {
     {
         var f = BoundTargetFunction as Function;
         var f = BoundTargetFunction as Function;
         if (f is null)
         if (f is null)
@@ -55,7 +55,7 @@ public sealed class BindFunction : ObjectInstance, IConstructor, ICallable
         return value;
         return value;
     }
     }
 
 
-    ObjectInstance IConstructor.Construct(JsValue[] arguments, JsValue newTarget)
+    ObjectInstance IConstructor.Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var target = BoundTargetFunction as IConstructor;
         var target = BoundTargetFunction as IConstructor;
         if (target is null)
         if (target is null)
@@ -87,7 +87,7 @@ public sealed class BindFunction : ObjectInstance, IConstructor, ICallable
         return f.OrdinaryHasInstance(v);
         return f.OrdinaryHasInstance(v);
     }
     }
 
 
-    private JsValue[] CreateArguments(JsValue[] arguments)
+    private JsValue[] CreateArguments(JsCallArguments arguments)
     {
     {
         var combined = _engine._jsValueArrayPool.RentArray(BoundArguments.Length + arguments.Length);
         var combined = _engine._jsValueArrayPool.RentArray(BoundArguments.Length + arguments.Length);
         System.Array.Copy(BoundArguments, combined, BoundArguments.Length);
         System.Array.Copy(BoundArguments, combined, BoundArguments.Length);

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

@@ -25,7 +25,7 @@ public sealed class EvalFunction : Function
         _length = new PropertyDescriptor(JsNumber.PositiveOne, PropertyFlag.Configurable);
         _length = new PropertyDescriptor(JsNumber.PositiveOne, PropertyFlag.Configurable);
     }
     }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var callerRealm = _engine.ExecutionContext.Realm;
         var callerRealm = _engine.ExecutionContext.Realm;
         var x = arguments.At(0);
         var x = arguments.At(0);

+ 3 - 3
Jint/Native/Function/Function.cs

@@ -75,12 +75,12 @@ public abstract partial class Function : ObjectInstance, ICallable
 
 
     internal override bool IsCallable => true;
     internal override bool IsCallable => true;
 
 
-    JsValue ICallable.Call(JsValue thisObject, JsValue[] arguments) => Call(thisObject, arguments);
+    JsValue ICallable.Call(JsValue thisObject, params JsCallArguments arguments) => Call(thisObject, arguments);
 
 
     /// <summary>
     /// <summary>
     /// Executed when a function object is used as a function
     /// Executed when a function object is used as a function
     /// </summary>
     /// </summary>
-    protected internal abstract JsValue Call(JsValue thisObject, JsValue[] arguments);
+    protected internal abstract JsValue Call(JsValue thisObject, JsCallArguments arguments);
 
 
     public bool Strict => _thisMode == FunctionThisMode.Strict;
     public bool Strict => _thisMode == FunctionThisMode.Strict;
 
 
@@ -364,7 +364,7 @@ public abstract partial class Function : ObjectInstance, ICallable
     }
     }
 
 
     // native syntax doesn't expect to have private identifier indicator
     // native syntax doesn't expect to have private identifier indicator
-    private static readonly char[] _functionNameTrimStartChars = { '#' };
+    private static readonly char[] _functionNameTrimStartChars = ['#'];
 
 
     public override string ToString()
     public override string ToString()
     {
     {

+ 2 - 2
Jint/Native/Function/FunctionConstructor.cs

@@ -28,12 +28,12 @@ public sealed class FunctionConstructor : Constructor
 
 
     internal FunctionPrototype PrototypeObject { get; }
     internal FunctionPrototype PrototypeObject { get; }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return Construct(arguments, thisObject);
         return Construct(arguments, thisObject);
     }
     }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var function = CreateDynamicFunction(
         var function = CreateDynamicFunction(
             this,
             this,

+ 1 - 1
Jint/Native/Function/FunctionInstance.Dynamic.cs

@@ -20,7 +20,7 @@ public partial class Function
         ObjectInstance constructor,
         ObjectInstance constructor,
         JsValue newTarget,
         JsValue newTarget,
         FunctionKind kind,
         FunctionKind kind,
-        JsValue[] arguments)
+        JsCallArguments arguments)
     {
     {
         // TODO var callerContext = _engine.GetExecutionContext(1);
         // TODO var callerContext = _engine.GetExecutionContext(1);
         var callerContext = _engine.ExecutionContext;
         var callerContext = _engine.ExecutionContext;

+ 8 - 9
Jint/Native/Function/FunctionPrototype.cs

@@ -1,6 +1,5 @@
 #pragma warning disable CA1859 // Use concrete types when possible for improved performance -- most of prototype methods return JsValue
 #pragma warning disable CA1859 // Use concrete types when possible for improved performance -- most of prototype methods return JsValue
 
 
-using Jint.Collections;
 using Jint.Native.Array;
 using Jint.Native.Array;
 using Jint.Native.Object;
 using Jint.Native.Object;
 using Jint.Native.Symbol;
 using Jint.Native.Symbol;
@@ -52,7 +51,7 @@ internal sealed class FunctionPrototype : Function
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-function.prototype-@@hasinstance
     /// https://tc39.es/ecma262/#sec-function.prototype-@@hasinstance
     /// </summary>
     /// </summary>
-    private static JsValue HasInstance(JsValue thisObject, JsValue[] arguments)
+    private static JsValue HasInstance(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return thisObject.OrdinaryHasInstance(arguments.At(0));
         return thisObject.OrdinaryHasInstance(arguments.At(0));
     }
     }
@@ -60,7 +59,7 @@ internal sealed class FunctionPrototype : Function
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-function.prototype.bind
     /// https://tc39.es/ecma262/#sec-function.prototype.bind
     /// </summary>
     /// </summary>
-    private JsValue Bind(JsValue thisObject, JsValue[] arguments)
+    private JsValue Bind(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (thisObject is not (ICallable and ObjectInstance oi))
         if (thisObject is not (ICallable and ObjectInstance oi))
         {
         {
@@ -72,7 +71,7 @@ internal sealed class FunctionPrototype : Function
         var f = BoundFunctionCreate(oi, thisArg, arguments.Skip(1));
         var f = BoundFunctionCreate(oi, thisArg, arguments.Skip(1));
 
 
         JsNumber l;
         JsNumber l;
-        var targetHasLength = oi.HasOwnProperty(CommonProperties.Length) == true;
+        var targetHasLength = oi.HasOwnProperty(CommonProperties.Length);
         if (targetHasLength)
         if (targetHasLength)
         {
         {
             var targetLen = oi.Get(CommonProperties.Length);
             var targetLen = oi.Get(CommonProperties.Length);
@@ -130,7 +129,7 @@ internal sealed class FunctionPrototype : Function
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-function.prototype.tostring
     /// https://tc39.es/ecma262/#sec-function.prototype.tostring
     /// </summary>
     /// </summary>
-    private JsValue ToString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (thisObject.IsObject() && thisObject.IsCallable)
         if (thisObject.IsObject() && thisObject.IsCallable)
         {
         {
@@ -144,7 +143,7 @@ internal sealed class FunctionPrototype : Function
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-function.prototype.apply
     /// https://tc39.es/ecma262/#sec-function.prototype.apply
     /// </summary>
     /// </summary>
-    private JsValue Apply(JsValue thisObject, JsValue[] arguments)
+    private JsValue Apply(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var func = thisObject as ICallable;
         var func = thisObject as ICallable;
         if (func is null)
         if (func is null)
@@ -184,14 +183,14 @@ internal sealed class FunctionPrototype : Function
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-function.prototype.call
     /// https://tc39.es/ecma262/#sec-function.prototype.call
     /// </summary>
     /// </summary>
-    private JsValue CallImpl(JsValue thisObject, JsValue[] arguments)
+    private JsValue CallImpl(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var func = thisObject as ICallable;
         var func = thisObject as ICallable;
         if (func is null)
         if (func is null)
         {
         {
             ExceptionHelper.ThrowTypeError(_realm);
             ExceptionHelper.ThrowTypeError(_realm);
         }
         }
-        JsValue[] values = System.Array.Empty<JsValue>();
+        JsValue[] values = [];
         if (arguments.Length > 1)
         if (arguments.Length > 1)
         {
         {
             values = new JsValue[arguments.Length - 1];
             values = new JsValue[arguments.Length - 1];
@@ -203,7 +202,7 @@ internal sealed class FunctionPrototype : Function
         return result;
         return result;
     }
     }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return Undefined;
         return Undefined;
     }
     }

+ 2 - 2
Jint/Native/Function/ScriptFunction.cs

@@ -56,7 +56,7 @@ public sealed class ScriptFunction : Function, IConstructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-ecmascript-function-objects-call-thisargument-argumentslist
     /// https://tc39.es/ecma262/#sec-ecmascript-function-objects-call-thisargument-argumentslist
     /// </summary>
     /// </summary>
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var strict = _functionDefinition!.Strict || _thisMode == FunctionThisMode.Strict;
         var strict = _functionDefinition!.Strict || _thisMode == FunctionThisMode.Strict;
         using (new StrictModeScope(strict, true))
         using (new StrictModeScope(strict, true))
@@ -127,7 +127,7 @@ public sealed class ScriptFunction : Function, IConstructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-ecmascript-function-objects-construct-argumentslist-newtarget
     /// https://tc39.es/ecma262/#sec-ecmascript-function-objects-construct-argumentslist-newtarget
     /// </summary>
     /// </summary>
-    ObjectInstance IConstructor.Construct(JsValue[] arguments, JsValue newTarget)
+    ObjectInstance IConstructor.Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var callerContext = _engine.ExecutionContext;
         var callerContext = _engine.ExecutionContext;
         var kind = _constructorKind;
         var kind = _constructorKind;

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

@@ -14,7 +14,7 @@ internal sealed class ThrowTypeError : Function
         PreventExtensions();
         PreventExtensions();
     }
     }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         ExceptionHelper.ThrowTypeError(_realm);
         ExceptionHelper.ThrowTypeError(_realm);
         return null;
         return null;

+ 2 - 2
Jint/Native/Generator/GeneratorFunctionConstructor.cs

@@ -28,12 +28,12 @@ internal sealed class GeneratorFunctionConstructor : Constructor
 
 
     public GeneratorFunctionPrototype PrototypeObject { get; }
     public GeneratorFunctionPrototype PrototypeObject { get; }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return Construct(arguments, thisObject);
         return Construct(arguments, thisObject);
     }
     }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var function = _realm.Intrinsics.Function.CreateDynamicFunction(
         var function = _realm.Intrinsics.Function.CreateDynamicFunction(
             this,
             this,

+ 3 - 3
Jint/Native/Generator/GeneratorPrototype.cs

@@ -47,7 +47,7 @@ internal sealed class GeneratorPrototype : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-generator.prototype.next
     /// https://tc39.es/ecma262/#sec-generator.prototype.next
     /// </summary>
     /// </summary>
-    private ObjectInstance Next(JsValue thisObject, JsValue[] arguments)
+    private ObjectInstance Next(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var g = AssertGeneratorInstance(thisObject);
         var g = AssertGeneratorInstance(thisObject);
         var value = arguments.At(0, null!);
         var value = arguments.At(0, null!);
@@ -57,7 +57,7 @@ internal sealed class GeneratorPrototype : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-generator.prototype.return
     /// https://tc39.es/ecma262/#sec-generator.prototype.return
     /// </summary>
     /// </summary>
-    private JsValue Return(JsValue thisObject, JsValue[] arguments)
+    private JsValue Return(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var g = AssertGeneratorInstance(thisObject);
         var g = AssertGeneratorInstance(thisObject);
         var value = arguments.At(0);
         var value = arguments.At(0);
@@ -68,7 +68,7 @@ internal sealed class GeneratorPrototype : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-generator.prototype.throw
     /// https://tc39.es/ecma262/#sec-generator.prototype.throw
     /// </summary>
     /// </summary>
-    private JsValue Throw(JsValue thisObject, JsValue[] arguments)
+    private JsValue Throw(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var g = AssertGeneratorInstance(thisObject);
         var g = AssertGeneratorInstance(thisObject);
         var exception = arguments.At(0);
         var exception = arguments.At(0);

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

@@ -22,7 +22,7 @@ public sealed partial class GlobalObject : ObjectInstance
         _realm = realm;
         _realm = realm;
     }
     }
 
 
-    private JsValue ToStringString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToStringString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return _realm.Intrinsics.Object.PrototypeObject.ToObjectString(thisObject, Arguments.Empty);
         return _realm.Intrinsics.Object.PrototypeObject.ToObjectString(thisObject, Arguments.Empty);
     }
     }
@@ -30,7 +30,7 @@ public sealed partial class GlobalObject : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-parseint-string-radix
     /// https://tc39.es/ecma262/#sec-parseint-string-radix
     /// </summary>
     /// </summary>
-    internal static JsValue ParseInt(JsValue thisObject, JsValue[] arguments)
+    internal static JsValue ParseInt(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var inputString = TypeConverter.ToString(arguments.At(0));
         var inputString = TypeConverter.ToString(arguments.At(0));
         var trimmed = StringPrototype.TrimEx(inputString);
         var trimmed = StringPrototype.TrimEx(inputString);
@@ -119,7 +119,7 @@ public sealed partial class GlobalObject : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-parsefloat-string
     /// https://tc39.es/ecma262/#sec-parsefloat-string
     /// </summary>
     /// </summary>
-    internal static JsValue ParseFloat(JsValue thisObject, JsValue[] arguments)
+    internal static JsValue ParseFloat(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var inputString = TypeConverter.ToString(arguments.At(0));
         var inputString = TypeConverter.ToString(arguments.At(0));
         var trimmedString = StringPrototype.TrimStartEx(inputString);
         var trimmedString = StringPrototype.TrimStartEx(inputString);
@@ -240,7 +240,7 @@ public sealed partial class GlobalObject : ObjectInstance
     /// <summary>
     /// <summary>
     /// http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.2.4
     /// http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.2.4
     /// </summary>
     /// </summary>
-    private static JsValue IsNaN(JsValue thisObject, JsValue[] arguments)
+    private static JsValue IsNaN(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var value = arguments.At(0);
         var value = arguments.At(0);
 
 
@@ -256,7 +256,7 @@ public sealed partial class GlobalObject : ObjectInstance
     /// <summary>
     /// <summary>
     /// http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.2.5
     /// http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.2.5
     /// </summary>
     /// </summary>
-    private static JsValue IsFinite(JsValue thisObject, JsValue[] arguments)
+    private static JsValue IsFinite(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (arguments.Length != 1)
         if (arguments.Length != 1)
         {
         {
@@ -284,7 +284,7 @@ public sealed partial class GlobalObject : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-encodeuri-uri
     /// https://tc39.es/ecma262/#sec-encodeuri-uri
     /// </summary>
     /// </summary>
-    private JsValue EncodeUri(JsValue thisObject, JsValue[] arguments)
+    private JsValue EncodeUri(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var uriString = TypeConverter.ToString(arguments.At(0));
         var uriString = TypeConverter.ToString(arguments.At(0));
         return Encode(uriString, UnescapedUriSet);
         return Encode(uriString, UnescapedUriSet);
@@ -293,7 +293,7 @@ public sealed partial class GlobalObject : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-encodeuricomponent-uricomponent
     /// https://tc39.es/ecma262/#sec-encodeuricomponent-uricomponent
     /// </summary>
     /// </summary>
-    private JsValue EncodeUriComponent(JsValue thisObject, JsValue[] arguments)
+    private JsValue EncodeUriComponent(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var uriString = TypeConverter.ToString(arguments.At(0));
         var uriString = TypeConverter.ToString(arguments.At(0));
 
 
@@ -394,14 +394,14 @@ public sealed partial class GlobalObject : ObjectInstance
         return JsEmpty.Instance;
         return JsEmpty.Instance;
     }
     }
 
 
-    private JsValue DecodeUri(JsValue thisObject, JsValue[] arguments)
+    private JsValue DecodeUri(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var uriString = TypeConverter.ToString(arguments.At(0));
         var uriString = TypeConverter.ToString(arguments.At(0));
 
 
         return Decode(uriString, ReservedUriSet);
         return Decode(uriString, ReservedUriSet);
     }
     }
 
 
-    private JsValue DecodeUriComponent(JsValue thisObject, JsValue[] arguments)
+    private JsValue DecodeUriComponent(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var componentString = TypeConverter.ToString(arguments.At(0));
         var componentString = TypeConverter.ToString(arguments.At(0));
 
 
@@ -581,7 +581,7 @@ public sealed partial class GlobalObject : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-escape-string
     /// https://tc39.es/ecma262/#sec-escape-string
     /// </summary>
     /// </summary>
-    private JsValue Escape(JsValue thisObject, JsValue[] arguments)
+    private JsValue Escape(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var uriString = TypeConverter.ToString(arguments.At(0));
         var uriString = TypeConverter.ToString(arguments.At(0));
 
 
@@ -611,7 +611,7 @@ public sealed partial class GlobalObject : ObjectInstance
     /// <summary>
     /// <summary>
     /// http://www.ecma-international.org/ecma-262/5.1/#sec-B.2.2
     /// http://www.ecma-international.org/ecma-262/5.1/#sec-B.2.2
     /// </summary>
     /// </summary>
-    private JsValue Unescape(JsValue thisObject, JsValue[] arguments)
+    private JsValue Unescape(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var uriString = TypeConverter.ToString(arguments.At(0));
         var uriString = TypeConverter.ToString(arguments.At(0));
 
 
@@ -738,7 +738,7 @@ public sealed partial class GlobalObject : ObjectInstance
             return false;
             return false;
         }
         }
 
 
-        setter.Call(this, new[] {value});
+        setter.Call(this, value);
 
 
         return true;
         return true;
     }
     }

+ 1 - 1
Jint/Native/ICallable.cs

@@ -2,5 +2,5 @@ namespace Jint.Native;
 
 
 internal interface ICallable
 internal interface ICallable
 {
 {
-    JsValue Call(JsValue thisObject, params JsValue[] arguments);
+    JsValue Call(JsValue thisObject, params JsCallArguments arguments);
 }
 }

+ 1 - 1
Jint/Native/IConstructor.cs

@@ -4,5 +4,5 @@ namespace Jint.Native;
 
 
 internal interface IConstructor
 internal interface IConstructor
 {
 {
-    ObjectInstance Construct(JsValue[] arguments, JsValue newTarget);
+    ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget);
 }
 }

+ 1 - 1
Jint/Native/Intl/CollatorConstructor.cs

@@ -26,7 +26,7 @@ internal sealed class CollatorConstructor : Constructor
 
 
     public CollatorPrototype PrototypeObject { get; }
     public CollatorPrototype PrototypeObject { get; }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         throw new NotImplementedException();
         throw new NotImplementedException();
     }
     }

+ 1 - 1
Jint/Native/Intl/DateTimeFormatConstructor.cs

@@ -26,7 +26,7 @@ internal sealed class DateTimeFormatConstructor : Constructor
 
 
     public DateTimeFormatPrototype PrototypeObject { get; }
     public DateTimeFormatPrototype PrototypeObject { get; }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var locales = arguments.At(0);
         var locales = arguments.At(0);
         var options = arguments.At(1);
         var options = arguments.At(1);

+ 1 - 1
Jint/Native/Intl/DisplayNamesConstructor.cs

@@ -26,7 +26,7 @@ internal sealed class DisplayNamesConstructor : Constructor
 
 
     public DisplayNamesPrototype PrototypeObject { get; }
     public DisplayNamesPrototype PrototypeObject { get; }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         throw new NotImplementedException();
         throw new NotImplementedException();
     }
     }

+ 1 - 1
Jint/Native/Intl/IntlInstance.cs

@@ -50,7 +50,7 @@ internal sealed class IntlInstance : ObjectInstance
         SetSymbols(symbols);
         SetSymbols(symbols);
     }
     }
 
 
-    private JsValue GetCanonicalLocales(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetCanonicalLocales(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return new JsArray(_engine);
         return new JsArray(_engine);
     }
     }

+ 1 - 1
Jint/Native/Intl/ListFormatConstructor.cs

@@ -26,7 +26,7 @@ internal sealed class ListFormatConstructor : Constructor
 
 
     public ListFormatPrototype PrototypeObject { get; }
     public ListFormatPrototype PrototypeObject { get; }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         throw new NotImplementedException();
         throw new NotImplementedException();
     }
     }

+ 1 - 1
Jint/Native/Intl/LocaleConstructor.cs

@@ -26,7 +26,7 @@ internal sealed class LocaleConstructor : Constructor
 
 
     public LocalePrototype PrototypeObject { get; }
     public LocalePrototype PrototypeObject { get; }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         throw new NotImplementedException();
         throw new NotImplementedException();
     }
     }

+ 4 - 4
Jint/Native/Intl/NumberFormatConstructor.cs

@@ -41,7 +41,7 @@ internal sealed class NumberFormatConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma402/#sec-intl.numberformat
     /// https://tc39.es/ecma402/#sec-intl.numberformat
     /// </summary>
     /// </summary>
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var locales = arguments.At(0);
         var locales = arguments.At(0);
         var options = arguments.At(1);
         var options = arguments.At(1);
@@ -72,7 +72,7 @@ internal sealed class NumberFormatConstructor : Constructor
         var matcher = GetOption(options, "localeMatcher", OptionType.String, new JsValue[] { "lookup", "best fit" }, "best fit");
         var matcher = GetOption(options, "localeMatcher", OptionType.String, new JsValue[] { "lookup", "best fit" }, "best fit");
         opt["localeMatcher"] = matcher;
         opt["localeMatcher"] = matcher;
 
 
-        var numberingSystem = GetOption(options, "numberingSystem", OptionType.String, System.Array.Empty<JsValue>(), Undefined);
+        var numberingSystem = GetOption(options, "numberingSystem", OptionType.String, [], Undefined);
         if (!numberingSystem.IsUndefined())
         if (!numberingSystem.IsUndefined())
         {
         {
             // If numberingSystem does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception.
             // If numberingSystem does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception.
@@ -154,7 +154,7 @@ internal sealed class NumberFormatConstructor : Constructor
     {
     {
         var style = GetOption(options, "style", OptionType.String, new JsValue[] { "decimal", "percent", "currency", "unit" }, "decimal");
         var style = GetOption(options, "style", OptionType.String, new JsValue[] { "decimal", "percent", "currency", "unit" }, "decimal");
         intlObj["Style"] = style;
         intlObj["Style"] = style;
-        var currency = GetOption(options, "currency", OptionType.String, System.Array.Empty<JsValue>(), Undefined);
+        var currency = GetOption(options, "currency", OptionType.String, [], Undefined);
         if (currency.IsUndefined())
         if (currency.IsUndefined())
         {
         {
             if (style == "currency")
             if (style == "currency")
@@ -169,7 +169,7 @@ internal sealed class NumberFormatConstructor : Constructor
 
 
         var currencyDisplay = GetOption(options, "currencyDisplay", OptionType.String, new JsValue[] { "code", "symbol", "narrowSymbol", "name" }, "symbol");
         var currencyDisplay = GetOption(options, "currencyDisplay", OptionType.String, new JsValue[] { "code", "symbol", "narrowSymbol", "name" }, "symbol");
         var currencySign = GetOption(options, "currencySign", OptionType.String, new JsValue[] { "standard", "accounting" }, "standard");
         var currencySign = GetOption(options, "currencySign", OptionType.String, new JsValue[] { "standard", "accounting" }, "standard");
-        var unit = GetOption(options, "unit", OptionType.String, System.Array.Empty<JsValue>(), Undefined);
+        var unit = GetOption(options, "unit", OptionType.String, [], Undefined);
 
 
         if (unit.IsUndefined())
         if (unit.IsUndefined())
         {
         {

+ 1 - 1
Jint/Native/Intl/PluralRulesConstructor.cs

@@ -26,7 +26,7 @@ internal sealed class PluralRulesConstructor : Constructor
 
 
     public PluralRulesPrototype PrototypeObject { get; }
     public PluralRulesPrototype PrototypeObject { get; }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var locales = arguments.At(0);
         var locales = arguments.At(0);
         var options = arguments.At(1);
         var options = arguments.At(1);

+ 1 - 1
Jint/Native/Intl/RelativeTimeFormatConstructor.cs

@@ -26,7 +26,7 @@ internal sealed class RelativeTimeFormatConstructor : Constructor
 
 
     public RelativeTimeFormatPrototype PrototypeObject { get; }
     public RelativeTimeFormatPrototype PrototypeObject { get; }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var locales = arguments.At(0);
         var locales = arguments.At(0);
         var options = arguments.At(1);
         var options = arguments.At(1);

+ 1 - 1
Jint/Native/Intl/SegmenterConstructor.cs

@@ -26,7 +26,7 @@ internal sealed class SegmenterConstructor : Constructor
 
 
     public SegmenterPrototype PrototypeObject { get; }
     public SegmenterPrototype PrototypeObject { get; }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         throw new NotImplementedException();
         throw new NotImplementedException();
     }
     }

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

@@ -28,12 +28,12 @@ internal class IteratorPrototype : Prototype
         SetSymbols(symbols);
         SetSymbols(symbols);
     }
     }
 
 
-    private static JsValue ToIterator(JsValue thisObject, JsValue[] arguments)
+    private static JsValue ToIterator(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return thisObject;
         return thisObject;
     }
     }
 
 
-    internal JsValue Next(JsValue thisObject, JsValue[] arguments)
+    internal JsValue Next(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var iterator = thisObject as IteratorInstance;
         var iterator = thisObject as IteratorInstance;
         if (iterator is null)
         if (iterator is null)

+ 1 - 1
Jint/Native/Iterator/IteratorResult.cs

@@ -26,7 +26,7 @@ internal sealed class IteratorResult : ObjectInstance
     public static IteratorResult CreateKeyValueIteratorPosition(Engine engine, JsValue? key = null, JsValue? value = null)
     public static IteratorResult CreateKeyValueIteratorPosition(Engine engine, JsValue? key = null, JsValue? value = null)
     {
     {
         var done = key is null && value is null;
         var done = key is null && value is null;
-        var array = done ? Undefined : new JsArray(engine, new[] { key!, value! });
+        var array = done ? Undefined : new JsArray(engine, [key!, value!]);
 
 
         return new IteratorResult(engine, array, JsBoolean.Create(done));
         return new IteratorResult(engine, array, JsBoolean.Create(done));
     }
     }

+ 1 - 1
Jint/Native/JsArguments.cs

@@ -161,7 +161,7 @@ public sealed class JsArguments : ObjectInstance
             {
             {
                 return false;
                 return false;
             }
             }
-            setter.Call(receiver, new[] {value});
+            setter.Call(receiver, value);
         }
         }
         else
         else
         {
         {

+ 1 - 1
Jint/Native/JsArrayBuffer.cs

@@ -340,7 +340,7 @@ public class JsArrayBuffer : ObjectInstance
             ExceptionHelper.ThrowRangeError(_engine.Realm);
             ExceptionHelper.ThrowRangeError(_engine.Realm);
         }
         }
 
 
-        var oldBlock = _arrayBufferData ?? System.Array.Empty<byte>();
+        var oldBlock = _arrayBufferData ?? [];
         var newBlock = CreateByteDataBlock(_engine.Realm, newByteLength);
         var newBlock = CreateByteDataBlock(_engine.Realm, newByteLength);
         var copyLength = System.Math.Min(newByteLength, ArrayBufferByteLength);
         var copyLength = System.Math.Min(newByteLength, ArrayBufferByteLength);
 
 

+ 2 - 2
Jint/Native/JsPromise.cs

@@ -54,7 +54,7 @@ internal sealed class JsPromise : ObjectInstance
     }
     }
 
 
     // https://tc39.es/ecma262/#sec-promise-resolve-functions
     // https://tc39.es/ecma262/#sec-promise-resolve-functions
-    private JsValue Resolve(JsValue thisObject, JsValue[] arguments)
+    private JsValue Resolve(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var result = arguments.At(0);
         var result = arguments.At(0);
         return Resolve(result);
         return Resolve(result);
@@ -97,7 +97,7 @@ internal sealed class JsPromise : ObjectInstance
     }
     }
 
 
     // https://tc39.es/ecma262/#sec-promise-reject-functions
     // https://tc39.es/ecma262/#sec-promise-reject-functions
-    private JsValue Reject(JsValue thisObject, JsValue[] arguments)
+    private JsValue Reject(JsValue thisObject, JsCallArguments arguments)
     {
     {
         // Note that alreadyResolved logic lives in CreateResolvingFunctions method
         // Note that alreadyResolved logic lives in CreateResolvingFunctions method
 
 

+ 14 - 14
Jint/Native/JsProxy.cs

@@ -41,7 +41,7 @@ internal sealed class JsProxy : ObjectInstance, IConstructor, ICallable
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-call-thisargument-argumentslist
     /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-call-thisargument-argumentslist
     /// </summary>
     /// </summary>
-    JsValue ICallable.Call(JsValue thisObject, JsValue[] arguments)
+    JsValue ICallable.Call(JsValue thisObject, params JsCallArguments arguments)
     {
     {
         if (_target is not ICallable)
         if (_target is not ICallable)
         {
         {
@@ -66,7 +66,7 @@ internal sealed class JsProxy : ObjectInstance, IConstructor, ICallable
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-construct-argumentslist-newtarget
     /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-construct-argumentslist-newtarget
     /// </summary>
     /// </summary>
-    ObjectInstance IConstructor.Construct(JsValue[] arguments, JsValue newTarget)
+    ObjectInstance IConstructor.Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         if (_target is not ICallable)
         if (_target is not ICallable)
         {
         {
@@ -75,7 +75,7 @@ internal sealed class JsProxy : ObjectInstance, IConstructor, ICallable
 
 
         var argArray = _engine.Realm.Intrinsics.Array.Construct(arguments, _engine.Realm.Intrinsics.Array);
         var argArray = _engine.Realm.Intrinsics.Array.Construct(arguments, _engine.Realm.Intrinsics.Array);
 
 
-        if (!TryCallHandler(TrapConstruct, new[] { _target, argArray, newTarget }, out var result))
+        if (!TryCallHandler(TrapConstruct, [_target, argArray, newTarget], out var result))
         {
         {
             var constructor = _target as IConstructor;
             var constructor = _target as IConstructor;
             if (constructor is null)
             if (constructor is null)
@@ -128,7 +128,7 @@ internal sealed class JsProxy : ObjectInstance, IConstructor, ICallable
         AssertTargetNotRevoked(property);
         AssertTargetNotRevoked(property);
         var target = _target;
         var target = _target;
 
 
-        if (KeyFunctionRevoke.Equals(property) || !TryCallHandler(TrapGet, new[] { target, TypeConverter.ToPropertyKey(property), receiver }, out var result))
+        if (KeyFunctionRevoke.Equals(property) || !TryCallHandler(TrapGet, [target, TypeConverter.ToPropertyKey(property), receiver], out var result))
         {
         {
             return target.Get(property, receiver);
             return target.Get(property, receiver);
         }
         }
@@ -162,7 +162,7 @@ internal sealed class JsProxy : ObjectInstance, IConstructor, ICallable
     /// </summary>
     /// </summary>
     public override List<JsValue> GetOwnPropertyKeys(Types types = Types.Empty | Types.String | Types.Symbol)
     public override List<JsValue> GetOwnPropertyKeys(Types types = Types.Empty | Types.String | Types.Symbol)
     {
     {
-        if (!TryCallHandler(TrapOwnKeys, new[] { _target }, out var result))
+        if (!TryCallHandler(TrapOwnKeys, [_target], out var result))
         {
         {
             return _target.GetOwnPropertyKeys(types);
             return _target.GetOwnPropertyKeys(types);
         }
         }
@@ -229,7 +229,7 @@ internal sealed class JsProxy : ObjectInstance, IConstructor, ICallable
     /// </summary>
     /// </summary>
     public override PropertyDescriptor GetOwnProperty(JsValue property)
     public override PropertyDescriptor GetOwnProperty(JsValue property)
     {
     {
-        if (!TryCallHandler(TrapGetOwnPropertyDescriptor, new[] { _target, TypeConverter.ToPropertyKey(property) }, out var trapResultObj))
+        if (!TryCallHandler(TrapGetOwnPropertyDescriptor, [_target, TypeConverter.ToPropertyKey(property)], out var trapResultObj))
         {
         {
             return _target.GetOwnProperty(property);
             return _target.GetOwnProperty(property);
         }
         }
@@ -320,7 +320,7 @@ internal sealed class JsProxy : ObjectInstance, IConstructor, ICallable
     /// </summary>
     /// </summary>
     public override bool Set(JsValue property, JsValue value, JsValue receiver)
     public override bool Set(JsValue property, JsValue value, JsValue receiver)
     {
     {
-        if (!TryCallHandler(TrapSet, new[] { _target, TypeConverter.ToPropertyKey(property), value, receiver }, out var trapResult))
+        if (!TryCallHandler(TrapSet, [_target, TypeConverter.ToPropertyKey(property), value, receiver], out var trapResult))
         {
         {
             return _target.Set(property, value, receiver);
             return _target.Set(property, value, receiver);
         }
         }
@@ -416,7 +416,7 @@ internal sealed class JsProxy : ObjectInstance, IConstructor, ICallable
     /// </summary>
     /// </summary>
     public override bool HasProperty(JsValue property)
     public override bool HasProperty(JsValue property)
     {
     {
-        if (!TryCallHandler(TrapHas, new[] { _target, TypeConverter.ToPropertyKey(property) }, out var jsValue))
+        if (!TryCallHandler(TrapHas, [_target, TypeConverter.ToPropertyKey(property)], out var jsValue))
         {
         {
             return _target.HasProperty(property);
             return _target.HasProperty(property);
         }
         }
@@ -448,7 +448,7 @@ internal sealed class JsProxy : ObjectInstance, IConstructor, ICallable
     /// </summary>
     /// </summary>
     public override bool Delete(JsValue property)
     public override bool Delete(JsValue property)
     {
     {
-        if (!TryCallHandler(TrapDeleteProperty, new[] { _target, TypeConverter.ToPropertyKey(property) }, out var result))
+        if (!TryCallHandler(TrapDeleteProperty, [_target, TypeConverter.ToPropertyKey(property)], out var result))
         {
         {
             return _target.Delete(property);
             return _target.Delete(property);
         }
         }
@@ -485,7 +485,7 @@ internal sealed class JsProxy : ObjectInstance, IConstructor, ICallable
     /// </summary>
     /// </summary>
     public override bool PreventExtensions()
     public override bool PreventExtensions()
     {
     {
-        if (!TryCallHandler(TrapPreventExtensions, new[] { _target }, out var result))
+        if (!TryCallHandler(TrapPreventExtensions, [_target], out var result))
         {
         {
             return _target.PreventExtensions();
             return _target.PreventExtensions();
         }
         }
@@ -507,7 +507,7 @@ internal sealed class JsProxy : ObjectInstance, IConstructor, ICallable
     {
     {
         get
         get
         {
         {
-            if (!TryCallHandler(TrapIsExtensible, new[] { _target }, out var result))
+            if (!TryCallHandler(TrapIsExtensible, [_target], out var result))
             {
             {
                 return _target.Extensible;
                 return _target.Extensible;
             }
             }
@@ -527,7 +527,7 @@ internal sealed class JsProxy : ObjectInstance, IConstructor, ICallable
     /// </summary>
     /// </summary>
     protected internal override ObjectInstance? GetPrototypeOf()
     protected internal override ObjectInstance? GetPrototypeOf()
     {
     {
-        if (!TryCallHandler(TrapGetProtoTypeOf, new[] { _target }, out var handlerProto))
+        if (!TryCallHandler(TrapGetProtoTypeOf, [_target], out var handlerProto))
         {
         {
             return _target.Prototype;
             return _target.Prototype;
         }
         }
@@ -555,7 +555,7 @@ internal sealed class JsProxy : ObjectInstance, IConstructor, ICallable
     /// </summary>
     /// </summary>
     internal override bool SetPrototypeOf(JsValue value)
     internal override bool SetPrototypeOf(JsValue value)
     {
     {
-        if (!TryCallHandler(TrapSetProtoTypeOf, new[] { _target, value }, out var result))
+        if (!TryCallHandler(TrapSetProtoTypeOf, [_target, value], out var result))
         {
         {
             return _target.SetPrototypeOf(value);
             return _target.SetPrototypeOf(value);
         }
         }
@@ -582,7 +582,7 @@ internal sealed class JsProxy : ObjectInstance, IConstructor, ICallable
 
 
     internal override bool IsCallable { get; }
     internal override bool IsCallable { get; }
 
 
-    private bool TryCallHandler(JsValue propertyName, JsValue[] arguments, out JsValue result)
+    private bool TryCallHandler(JsValue propertyName, JsCallArguments arguments, out JsValue result)
     {
     {
         AssertNotRevoked(propertyName);
         AssertNotRevoked(propertyName);
 
 

+ 1 - 1
Jint/Native/JsValue.cs

@@ -291,7 +291,7 @@ public abstract partial class JsValue : IEquatable<JsValue>
         var instOfHandler = oi.GetMethod(GlobalSymbolRegistry.HasInstance);
         var instOfHandler = oi.GetMethod(GlobalSymbolRegistry.HasInstance);
         if (instOfHandler is not null)
         if (instOfHandler is not null)
         {
         {
-            return TypeConverter.ToBoolean(instOfHandler.Call(target, new[] { this }));
+            return TypeConverter.ToBoolean(instOfHandler.Call(target, this));
         }
         }
 
 
         if (!target.IsCallable)
         if (!target.IsCallable)

+ 3 - 3
Jint/Native/Json/JsonInstance.cs

@@ -81,13 +81,13 @@ internal sealed class JsonInstance : ObjectInstance
             }
             }
         }
         }
 
 
-        return reviver.Call(holder, new[] { name, temp });
+        return reviver.Call(holder, name, temp);
     }
     }
 
 
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-json.parse
     /// https://tc39.es/ecma262/#sec-json.parse
     /// </summary>
     /// </summary>
-    private JsValue Parse(JsValue thisObject, JsValue[] arguments)
+    private JsValue Parse(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var jsonString = TypeConverter.ToString(arguments.At(0));
         var jsonString = TypeConverter.ToString(arguments.At(0));
         var reviver = arguments.At(1);
         var reviver = arguments.At(1);
@@ -108,7 +108,7 @@ internal sealed class JsonInstance : ObjectInstance
         }
         }
     }
     }
 
 
-    private JsValue Stringify(JsValue thisObject, JsValue[] arguments)
+    private JsValue Stringify(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var value = arguments.At(0);
         var value = arguments.At(0);
         var replacer = arguments.At(1);
         var replacer = arguments.At(1);

+ 2 - 2
Jint/Native/Json/JsonSerializer.cs

@@ -254,7 +254,7 @@ public sealed class JsonSerializer
             {
             {
                 if (toJson.AsObject() is ICallable callableToJson)
                 if (toJson.AsObject() is ICallable callableToJson)
                 {
                 {
-                    value = callableToJson.Call(value, Arguments.From(TypeConverter.ToPropertyKey(key)));
+                    value = callableToJson.Call(value, TypeConverter.ToPropertyKey(key));
                 }
                 }
             }
             }
         }
         }
@@ -262,7 +262,7 @@ public sealed class JsonSerializer
         if (!_replacerFunction.IsUndefined())
         if (!_replacerFunction.IsUndefined())
         {
         {
             var replacerFunctionCallable = (ICallable) _replacerFunction.AsObject();
             var replacerFunctionCallable = (ICallable) _replacerFunction.AsObject();
-            value = replacerFunctionCallable.Call(holder, Arguments.From(TypeConverter.ToPropertyKey(key), value));
+            value = replacerFunctionCallable.Call(holder, TypeConverter.ToPropertyKey(key), value);
         }
         }
 
 
         if (value.IsObject())
         if (value.IsObject())

+ 3 - 3
Jint/Native/Map/MapConstructor.cs

@@ -45,7 +45,7 @@ public sealed class MapConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-map-iterable
     /// https://tc39.es/ecma262/#sec-map-iterable
     /// </summary>
     /// </summary>
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var map = ConstructMap(newTarget);
         var map = ConstructMap(newTarget);
 
 
@@ -79,7 +79,7 @@ public sealed class MapConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/proposal-array-grouping/#sec-map.groupby
     /// https://tc39.es/proposal-array-grouping/#sec-map.groupby
     /// </summary>
     /// </summary>
-    private JsValue GroupBy(JsValue thisObject, JsValue[] arguments)
+    private JsValue GroupBy(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var items = arguments.At(0);
         var items = arguments.At(0);
         var callbackfn = arguments.At(1);
         var callbackfn = arguments.At(1);
@@ -93,7 +93,7 @@ public sealed class MapConstructor : Constructor
         return map;
         return map;
     }
     }
 
 
-    private static JsValue Species(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Species(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return thisObject;
         return thisObject;
     }
     }

+ 10 - 10
Jint/Native/Map/MapPrototype.cs

@@ -54,26 +54,26 @@ internal sealed class MapPrototype : Prototype
         SetSymbols(symbols);
         SetSymbols(symbols);
     }
     }
 
 
-    private JsValue Size(JsValue thisObject, JsValue[] arguments)
+    private JsValue Size(JsValue thisObject, JsCallArguments arguments)
     {
     {
         AssertMapInstance(thisObject);
         AssertMapInstance(thisObject);
         return JsNumber.Create(0);
         return JsNumber.Create(0);
     }
     }
 
 
-    private JsValue Get(JsValue thisObject, JsValue[] arguments)
+    private JsValue Get(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var map = AssertMapInstance(thisObject);
         var map = AssertMapInstance(thisObject);
         return map.Get(arguments.At(0));
         return map.Get(arguments.At(0));
     }
     }
 
 
-    private JsValue Clear(JsValue thisObject, JsValue[] arguments)
+    private JsValue Clear(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var map = AssertMapInstance(thisObject);
         var map = AssertMapInstance(thisObject);
         map.Clear();
         map.Clear();
         return Undefined;
         return Undefined;
     }
     }
 
 
-    private JsValue Delete(JsValue thisObject, JsValue[] arguments)
+    private JsValue Delete(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var map = AssertMapInstance(thisObject);
         var map = AssertMapInstance(thisObject);
         return map.Remove(arguments.At(0))
         return map.Remove(arguments.At(0))
@@ -81,14 +81,14 @@ internal sealed class MapPrototype : Prototype
             : JsBoolean.False;
             : JsBoolean.False;
     }
     }
 
 
-    private JsValue Set(JsValue thisObject, JsValue[] arguments)
+    private JsValue Set(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var map = AssertMapInstance(thisObject);
         var map = AssertMapInstance(thisObject);
         map.Set(arguments.At(0), arguments.At(1));
         map.Set(arguments.At(0), arguments.At(1));
         return thisObject;
         return thisObject;
     }
     }
 
 
-    private JsValue Has(JsValue thisObject, JsValue[] arguments)
+    private JsValue Has(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var map = AssertMapInstance(thisObject);
         var map = AssertMapInstance(thisObject);
         return map.Has(arguments.At(0))
         return map.Has(arguments.At(0))
@@ -96,7 +96,7 @@ internal sealed class MapPrototype : Prototype
             : JsBoolean.False;
             : JsBoolean.False;
     }
     }
 
 
-    private JsValue ForEach(JsValue thisObject, JsValue[] arguments)
+    private JsValue ForEach(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var map = AssertMapInstance(thisObject);
         var map = AssertMapInstance(thisObject);
         var callbackfn = arguments.At(0);
         var callbackfn = arguments.At(0);
@@ -109,19 +109,19 @@ internal sealed class MapPrototype : Prototype
         return Undefined;
         return Undefined;
     }
     }
 
 
-    private ObjectInstance Entries(JsValue thisObject, JsValue[] arguments)
+    private ObjectInstance Entries(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var map = AssertMapInstance(thisObject);
         var map = AssertMapInstance(thisObject);
         return map.Iterator();
         return map.Iterator();
     }
     }
 
 
-    private ObjectInstance Keys(JsValue thisObject, JsValue[] arguments)
+    private ObjectInstance Keys(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var map = AssertMapInstance(thisObject);
         var map = AssertMapInstance(thisObject);
         return map.Keys();
         return map.Keys();
     }
     }
 
 
-    private ObjectInstance Values(JsValue thisObject, JsValue[] arguments)
+    private ObjectInstance Values(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var map = AssertMapInstance(thisObject);
         var map = AssertMapInstance(thisObject);
         return map.Values();
         return map.Values();

+ 38 - 38
Jint/Native/Math/MathInstance.cs

@@ -76,7 +76,7 @@ internal sealed class MathInstance : ObjectInstance
         SetSymbols(symbols);
         SetSymbols(symbols);
     }
     }
 
 
-    private static JsValue Abs(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Abs(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -96,7 +96,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Abs(x);
         return System.Math.Abs(x);
     }
     }
 
 
-    private static JsValue Acos(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Acos(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -112,7 +112,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Acos(x);
         return System.Math.Acos(x);
     }
     }
 
 
-    private static JsValue Acosh(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Acosh(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -124,7 +124,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Log(x + System.Math.Sqrt(x * x - 1.0));
         return System.Math.Log(x + System.Math.Sqrt(x * x - 1.0));
     }
     }
 
 
-    private static JsValue Asin(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Asin(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -140,7 +140,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Asin(x);
         return System.Math.Asin(x);
     }
     }
 
 
-    private static JsValue Asinh(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Asinh(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
         if (double.IsInfinity(x) || NumberInstance.IsPositiveZero(x) || NumberInstance.IsNegativeZero(x))
         if (double.IsInfinity(x) || NumberInstance.IsPositiveZero(x) || NumberInstance.IsNegativeZero(x))
@@ -151,7 +151,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Log(x + System.Math.Sqrt(x * x + 1.0));
         return System.Math.Log(x + System.Math.Sqrt(x * x + 1.0));
     }
     }
 
 
-    private static JsValue Atan(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Atan(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -174,7 +174,7 @@ internal sealed class MathInstance : ObjectInstance
 
 
         return System.Math.Atan(x);
         return System.Math.Atan(x);
     }
     }
-    private static JsValue Atanh(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Atanh(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -191,7 +191,7 @@ internal sealed class MathInstance : ObjectInstance
         return 0.5 * System.Math.Log((1.0 + x) / (1.0 - x));
         return 0.5 * System.Math.Log((1.0 + x) / (1.0 - x));
     }
     }
 
 
-    private static JsValue Atan2(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Atan2(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var y = TypeConverter.ToNumber(arguments.At(0));
         var y = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(1));
         var x = TypeConverter.ToNumber(arguments.At(1));
@@ -339,7 +339,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Atan2(y, x);
         return System.Math.Atan2(y, x);
     }
     }
 
 
-    private static JsValue Ceil(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Ceil(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -374,7 +374,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Ceiling(x);
         return System.Math.Ceiling(x);
     }
     }
 
 
-    private static JsValue Cos(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Cos(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -398,7 +398,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Cos(x);
         return System.Math.Cos(x);
     }
     }
 
 
-    private static JsValue Cosh(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Cosh(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -422,7 +422,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Cosh(x);
         return System.Math.Cosh(x);
     }
     }
 
 
-    private static JsValue Exp(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Exp(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -446,7 +446,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Exp(x);
         return System.Math.Exp(x);
     }
     }
 
 
-    private static JsValue Expm1(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Expm1(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -462,7 +462,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Exp(x) - 1.0;
         return System.Math.Exp(x) - 1.0;
     }
     }
 
 
-    private static JsValue Floor(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Floor(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -490,7 +490,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Floor(x);
         return System.Math.Floor(x);
     }
     }
 
 
-    private static JsValue Log(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Log(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -518,7 +518,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Log(x);
         return System.Math.Log(x);
     }
     }
 
 
-    private static JsValue Log1p(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Log1p(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -545,7 +545,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Log(1 + x);
         return System.Math.Log(1 + x);
     }
     }
 
 
-    private static JsValue Log2(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Log2(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -573,7 +573,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Log(x, 2);
         return System.Math.Log(x, 2);
     }
     }
 
 
-    private static JsValue Log10(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Log10(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -604,7 +604,7 @@ internal sealed class MathInstance : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-math.max
     /// https://tc39.es/ecma262/#sec-math.max
     /// </summary>
     /// </summary>
-    private static JsValue Max(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Max(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (arguments.Length == 0)
         if (arguments.Length == 0)
         {
         {
@@ -636,7 +636,7 @@ internal sealed class MathInstance : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-math.min
     /// https://tc39.es/ecma262/#sec-math.min
     /// </summary>
     /// </summary>
-    private static JsValue Min(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Min(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (arguments.Length == 0)
         if (arguments.Length == 0)
         {
         {
@@ -665,7 +665,7 @@ internal sealed class MathInstance : ObjectInstance
         return lowest;
         return lowest;
     }
     }
 
 
-    private static JsValue Pow(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Pow(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
         var y = TypeConverter.ToNumber(arguments.At(1));
         var y = TypeConverter.ToNumber(arguments.At(1));
@@ -819,7 +819,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Pow(x, y);
         return System.Math.Pow(x, y);
     }
     }
 
 
-    private JsValue Random(JsValue thisObject, JsValue[] arguments)
+    private JsValue Random(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if(_random == null)
         if(_random == null)
         {
         {
@@ -829,7 +829,7 @@ internal sealed class MathInstance : ObjectInstance
         return _random.NextDouble();
         return _random.NextDouble();
     }
     }
 
 
-    private static JsValue Round(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Round(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
         var round = System.Math.Round(x);
         var round = System.Math.Round(x);
@@ -841,7 +841,7 @@ internal sealed class MathInstance : ObjectInstance
         return round;
         return round;
     }
     }
 
 
-    private static JsValue Fround(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Fround(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = arguments.At(0);
         var x = arguments.At(0);
         var n = TypeConverter.ToNumber(x);
         var n = TypeConverter.ToNumber(x);
@@ -851,7 +851,7 @@ internal sealed class MathInstance : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/proposal-float16array/#sec-math.f16round
     /// https://tc39.es/proposal-float16array/#sec-math.f16round
     /// </summary>
     /// </summary>
-    private static JsValue F16Round(JsValue thisObject, JsValue[] arguments)
+    private static JsValue F16Round(JsValue thisObject, JsCallArguments arguments)
     {
     {
 #if SUPPORTS_HALF
 #if SUPPORTS_HALF
             var x = arguments.At(0);
             var x = arguments.At(0);
@@ -874,7 +874,7 @@ internal sealed class MathInstance : ObjectInstance
 #endif
 #endif
     }
     }
 
 
-    private static JsValue Sin(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Sin(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -898,7 +898,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Sin(x);
         return System.Math.Sin(x);
     }
     }
 
 
-    private static JsValue Sinh(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Sinh(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -926,25 +926,25 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Sinh(x);
         return System.Math.Sinh(x);
     }
     }
 
 
-    private static JsValue Sqrt(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Sqrt(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
         return System.Math.Sqrt(x);
         return System.Math.Sqrt(x);
     }
     }
 
 
-    private static JsValue Tan(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Tan(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
         return System.Math.Tan(x);
         return System.Math.Tan(x);
     }
     }
 
 
-    private static JsValue Tanh(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Tanh(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
         return System.Math.Tanh(x);
         return System.Math.Tanh(x);
     }
     }
 
 
-    private static JsValue Truncate(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Truncate(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -971,7 +971,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Truncate(x);
         return System.Math.Truncate(x);
     }
     }
 
 
-    private static JsValue Sign(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Sign(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -998,7 +998,7 @@ internal sealed class MathInstance : ObjectInstance
         return System.Math.Sign(x);
         return System.Math.Sign(x);
     }
     }
 
 
-    private static JsValue Cbrt(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Cbrt(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToNumber(arguments.At(0));
         var x = TypeConverter.ToNumber(arguments.At(0));
 
 
@@ -1030,7 +1030,7 @@ internal sealed class MathInstance : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-math.hypot
     /// https://tc39.es/ecma262/#sec-math.hypot
     /// </summary>
     /// </summary>
-    private static JsValue Hypot(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Hypot(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var coerced = Coerced(arguments);
         var coerced = Coerced(arguments);
 
 
@@ -1070,7 +1070,7 @@ internal sealed class MathInstance : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://github.com/tc39/proposal-math-sum
     /// https://github.com/tc39/proposal-math-sum
     /// </summary>
     /// </summary>
-    private JsValue SumPrecise(JsValue thisObject, JsValue[] arguments)
+    private JsValue SumPrecise(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var items = arguments.At(0);
         var items = arguments.At(0);
         if (items.IsNullOrUndefined())
         if (items.IsNullOrUndefined())
@@ -1157,7 +1157,7 @@ internal sealed class MathInstance : ObjectInstance
         return Math.SumPrecise.Sum(sum);
         return Math.SumPrecise.Sum(sum);
     }
     }
 
 
-    private static double[] Coerced(JsValue[] arguments)
+    private static double[] Coerced(JsCallArguments arguments)
     {
     {
         // TODO stackalloc
         // TODO stackalloc
         var coerced = new double[arguments.Length];
         var coerced = new double[arguments.Length];
@@ -1170,7 +1170,7 @@ internal sealed class MathInstance : ObjectInstance
         return coerced;
         return coerced;
     }
     }
 
 
-    private static JsValue Imul(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Imul(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToInt32(arguments.At(0));
         var x = TypeConverter.ToInt32(arguments.At(0));
         var y = TypeConverter.ToInt32(arguments.At(1));
         var y = TypeConverter.ToInt32(arguments.At(1));
@@ -1178,7 +1178,7 @@ internal sealed class MathInstance : ObjectInstance
         return x * y;
         return x * y;
     }
     }
 
 
-    private static JsValue Clz32(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Clz32(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var x = TypeConverter.ToInt32(arguments.At(0));
         var x = TypeConverter.ToInt32(arguments.At(0));
         if (x < 0)
         if (x < 0)

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

@@ -87,7 +87,7 @@ internal static class CachedPowers
     // \{GRISU_UINT64_C\((\w+), (\w+)\), (\-?\d+), (\-?\d+)\}
     // \{GRISU_UINT64_C\((\w+), (\w+)\), (\-?\d+), (\-?\d+)\}
 
 
     private static readonly CachedPower[] CACHED_POWERS =
     private static readonly CachedPower[] CACHED_POWERS =
-    {
+    [
         new CachedPower(0xFA8FD5A0081C0288, -1220, -348),
         new CachedPower(0xFA8FD5A0081C0288, -1220, -348),
         new CachedPower(0xBAAEE17FA23EBF76, -1193, -340),
         new CachedPower(0xBAAEE17FA23EBF76, -1193, -340),
         new CachedPower(0x8B16FB203055AC76, -1166, -332),
         new CachedPower(0x8B16FB203055AC76, -1166, -332),
@@ -175,7 +175,7 @@ internal static class CachedPowers
         new CachedPower(0x9E19DB92B4E31BA9, 1013, 324),
         new CachedPower(0x9E19DB92B4E31BA9, 1013, 324),
         new CachedPower(0xEB96BF6EBADF77D9, 1039, 332),
         new CachedPower(0xEB96BF6EBADF77D9, 1039, 332),
         new CachedPower(0xAF87023B9BF0EE6B, 1066, 340)
         new CachedPower(0xAF87023B9BF0EE6B, 1066, 340)
-    };
+    ];
 
 
     const int kCachedPowersOffset = 348;  // -1 * the first decimal_exponent.
     const int kCachedPowersOffset = 348;  // -1 * the first decimal_exponent.
     const int kDecimalExponentDistance = 8;
     const int kDecimalExponentDistance = 8;

+ 7 - 7
Jint/Native/Number/NumberConstructor.cs

@@ -53,7 +53,7 @@ internal sealed class NumberConstructor : Constructor
         SetProperties(properties);
         SetProperties(properties);
     }
     }
 
 
-    private static JsValue IsFinite(JsValue thisObject, JsValue[] arguments)
+    private static JsValue IsFinite(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (!(arguments.At(0) is JsNumber num))
         if (!(arguments.At(0) is JsNumber num))
         {
         {
@@ -63,7 +63,7 @@ internal sealed class NumberConstructor : Constructor
         return double.IsInfinity(num._value) || double.IsNaN(num._value) ? JsBoolean.False : JsBoolean.True;
         return double.IsInfinity(num._value) || double.IsNaN(num._value) ? JsBoolean.False : JsBoolean.True;
     }
     }
 
 
-    private static JsValue IsInteger(JsValue thisObject, JsValue[] arguments)
+    private static JsValue IsInteger(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (!(arguments.At(0) is JsNumber num))
         if (!(arguments.At(0) is JsNumber num))
         {
         {
@@ -80,7 +80,7 @@ internal sealed class NumberConstructor : Constructor
         return integer == num._value;
         return integer == num._value;
     }
     }
 
 
-    private static JsValue IsNaN(JsValue thisObject, JsValue[] arguments)
+    private static JsValue IsNaN(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (!(arguments.At(0) is JsNumber num))
         if (!(arguments.At(0) is JsNumber num))
         {
         {
@@ -90,7 +90,7 @@ internal sealed class NumberConstructor : Constructor
         return double.IsNaN(num._value);
         return double.IsNaN(num._value);
     }
     }
 
 
-    private static JsValue IsSafeInteger(JsValue thisObject, JsValue[] arguments)
+    private static JsValue IsSafeInteger(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (!(arguments.At(0) is JsNumber num))
         if (!(arguments.At(0) is JsNumber num))
         {
         {
@@ -112,7 +112,7 @@ internal sealed class NumberConstructor : Constructor
         return System.Math.Abs(integer) <= MaxSafeInteger;
         return System.Math.Abs(integer) <= MaxSafeInteger;
     }
     }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var n = ProcessFirstParameter(arguments);
         var n = ProcessFirstParameter(arguments);
         return n;
         return n;
@@ -121,7 +121,7 @@ internal sealed class NumberConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-number-constructor-number-value
     /// https://tc39.es/ecma262/#sec-number-constructor-number-value
     /// </summary>
     /// </summary>
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var n = ProcessFirstParameter(arguments);
         var n = ProcessFirstParameter(arguments);
 
 
@@ -137,7 +137,7 @@ internal sealed class NumberConstructor : Constructor
         return o;
         return o;
     }
     }
 
 
-    private static JsNumber ProcessFirstParameter(JsValue[] arguments)
+    private static JsNumber ProcessFirstParameter(JsCallArguments arguments)
     {
     {
         var n = JsNumber.PositiveZero;
         var n = JsNumber.PositiveZero;
         if (arguments.Length > 0)
         if (arguments.Length > 0)

+ 6 - 6
Jint/Native/Number/NumberPrototype.cs

@@ -51,7 +51,7 @@ internal sealed class NumberPrototype : NumberInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-number.prototype.tolocalestring
     /// https://tc39.es/ecma262/#sec-number.prototype.tolocalestring
     /// </summary>
     /// </summary>
-    private JsValue ToLocaleString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToLocaleString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (!thisObject.IsNumber() && thisObject is not NumberInstance)
         if (!thisObject.IsNumber() && thisObject is not NumberInstance)
         {
         {
@@ -106,7 +106,7 @@ internal sealed class NumberPrototype : NumberInstance
         return m.ToString("n", numberFormat);
         return m.ToString("n", numberFormat);
     }
     }
 
 
-    private JsValue ValueOf(JsValue thisObject, JsValue[] arguments)
+    private JsValue ValueOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (thisObject is NumberInstance ni)
         if (thisObject is NumberInstance ni)
         {
         {
@@ -124,7 +124,7 @@ internal sealed class NumberPrototype : NumberInstance
 
 
     private const double Ten21 = 1e21;
     private const double Ten21 = 1e21;
 
 
-    private JsValue ToFixed(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToFixed(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var f = (int) TypeConverter.ToInteger(arguments.At(0, 0));
         var f = (int) TypeConverter.ToInteger(arguments.At(0, 0));
         if (f < 0 || f > 100)
         if (f < 0 || f > 100)
@@ -162,7 +162,7 @@ internal sealed class NumberPrototype : NumberInstance
     /// <summary>
     /// <summary>
     /// https://www.ecma-international.org/ecma-262/6.0/#sec-number.prototype.toexponential
     /// https://www.ecma-international.org/ecma-262/6.0/#sec-number.prototype.toexponential
     /// </summary>
     /// </summary>
-    private JsValue ToExponential(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToExponential(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (!thisObject.IsNumber() && ReferenceEquals(thisObject.TryCast<NumberInstance>(), null))
         if (!thisObject.IsNumber() && ReferenceEquals(thisObject.TryCast<NumberInstance>(), null))
         {
         {
@@ -238,7 +238,7 @@ internal sealed class NumberPrototype : NumberInstance
         return result;
         return result;
     }
     }
 
 
-    private JsValue ToPrecision(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToPrecision(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (!thisObject.IsNumber() && ReferenceEquals(thisObject.TryCast<NumberInstance>(), null))
         if (!thisObject.IsNumber() && ReferenceEquals(thisObject.TryCast<NumberInstance>(), null))
         {
         {
@@ -358,7 +358,7 @@ internal sealed class NumberPrototype : NumberInstance
         return sb.ToString();
         return sb.ToString();
     }
     }
 
 
-    private JsValue ToNumberString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToNumberString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (!thisObject.IsNumber() && (ReferenceEquals(thisObject.TryCast<NumberInstance>(), null)))
         if (!thisObject.IsNumber() && (ReferenceEquals(thisObject.TryCast<NumberInstance>(), null)))
         {
         {

+ 27 - 27
Jint/Native/Object/ObjectConstructor.cs

@@ -62,7 +62,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.assign
     /// https://tc39.es/ecma262/#sec-object.assign
     /// </summary>
     /// </summary>
-    private JsValue Assign(JsValue thisObject, JsValue[] arguments)
+    private JsValue Assign(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var to = TypeConverter.ToObject(_realm, arguments.At(0));
         var to = TypeConverter.ToObject(_realm, arguments.At(0));
         if (arguments.Length < 2)
         if (arguments.Length < 2)
@@ -96,7 +96,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.entries
     /// https://tc39.es/ecma262/#sec-object.entries
     /// </summary>
     /// </summary>
-    private JsValue Entries(JsValue thisObject, JsValue[] arguments)
+    private JsValue Entries(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var obj = TypeConverter.ToObject(_realm, arguments.At(0));
         var obj = TypeConverter.ToObject(_realm, arguments.At(0));
         var nameList = obj.EnumerableOwnProperties(EnumerableOwnPropertyNamesKind.KeyValue);
         var nameList = obj.EnumerableOwnProperties(EnumerableOwnPropertyNamesKind.KeyValue);
@@ -106,7 +106,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.fromentries
     /// https://tc39.es/ecma262/#sec-object.fromentries
     /// </summary>
     /// </summary>
-    private JsValue FromEntries(JsValue thisObject, JsValue[] arguments)
+    private JsValue FromEntries(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var iterable = arguments.At(0);
         var iterable = arguments.At(0);
         TypeConverter.RequireObjectCoercible(_engine, iterable);
         TypeConverter.RequireObjectCoercible(_engine, iterable);
@@ -124,7 +124,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.is
     /// https://tc39.es/ecma262/#sec-object.is
     /// </summary>
     /// </summary>
-    private static JsValue Is(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Is(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return SameValue(arguments.At(0), arguments.At(1));
         return SameValue(arguments.At(0), arguments.At(1));
     }
     }
@@ -132,7 +132,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object-value
     /// https://tc39.es/ecma262/#sec-object-value
     /// </summary>
     /// </summary>
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (arguments.Length == 0)
         if (arguments.Length == 0)
         {
         {
@@ -150,12 +150,12 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object-value
     /// https://tc39.es/ecma262/#sec-object-value
     /// </summary>
     /// </summary>
-    public ObjectInstance Construct(JsValue[] arguments)
+    public ObjectInstance Construct(JsCallArguments arguments)
     {
     {
         return Construct(arguments, this);
         return Construct(arguments, this);
     }
     }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         if (!ReferenceEquals(this, newTarget) && !newTarget.IsUndefined())
         if (!ReferenceEquals(this, newTarget) && !newTarget.IsUndefined())
         {
         {
@@ -194,7 +194,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.getprototypeof
     /// https://tc39.es/ecma262/#sec-object.getprototypeof
     /// </summary>
     /// </summary>
-    public JsValue GetPrototypeOf(JsValue thisObject, JsValue[] arguments)
+    public JsValue GetPrototypeOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var obj = TypeConverter.ToObject(_realm, arguments.At(0));
         var obj = TypeConverter.ToObject(_realm, arguments.At(0));
         return obj.Prototype ?? Null;
         return obj.Prototype ?? Null;
@@ -203,7 +203,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.setprototypeof
     /// https://tc39.es/ecma262/#sec-object.setprototypeof
     /// </summary>
     /// </summary>
-    private JsValue SetPrototypeOf(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetPrototypeOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var oArg = arguments.At(0);
         var oArg = arguments.At(0);
         TypeConverter.RequireObjectCoercible(_engine, oArg);
         TypeConverter.RequireObjectCoercible(_engine, oArg);
@@ -229,7 +229,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.hasown
     /// https://tc39.es/ecma262/#sec-object.hasown
     /// </summary>
     /// </summary>
-    private JsValue HasOwn(JsValue thisObject, JsValue[] arguments)
+    private JsValue HasOwn(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = TypeConverter.ToObject(_realm, arguments.At(0));
         var o = TypeConverter.ToObject(_realm, arguments.At(0));
         var property = TypeConverter.ToPropertyKey(arguments.At(1));
         var property = TypeConverter.ToPropertyKey(arguments.At(1));
@@ -239,7 +239,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
     /// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
     /// </summary>
     /// </summary>
-    internal JsValue GetOwnPropertyDescriptor(JsValue thisObject, JsValue[] arguments)
+    internal JsValue GetOwnPropertyDescriptor(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = TypeConverter.ToObject(_realm, arguments.At(0));
         var o = TypeConverter.ToObject(_realm, arguments.At(0));
 
 
@@ -253,7 +253,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
     /// https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
     /// </summary>
     /// </summary>
-    private JsValue GetOwnPropertyDescriptors(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetOwnPropertyDescriptors(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = TypeConverter.ToObject(_realm, arguments.At(0));
         var o = TypeConverter.ToObject(_realm, arguments.At(0));
         var ownKeys = o.GetOwnPropertyKeys();
         var ownKeys = o.GetOwnPropertyKeys();
@@ -273,7 +273,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.getownpropertynames
     /// https://tc39.es/ecma262/#sec-object.getownpropertynames
     /// </summary>
     /// </summary>
-    private JsValue GetOwnPropertyNames(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetOwnPropertyNames(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = TypeConverter.ToObject(_realm, arguments.At(0));
         var o = TypeConverter.ToObject(_realm, arguments.At(0));
         var names = o.GetOwnPropertyKeys(Types.String);
         var names = o.GetOwnPropertyKeys(Types.String);
@@ -283,7 +283,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.getownpropertysymbols
     /// https://tc39.es/ecma262/#sec-object.getownpropertysymbols
     /// </summary>
     /// </summary>
-    private JsValue GetOwnPropertySymbols(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetOwnPropertySymbols(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = TypeConverter.ToObject(_realm, arguments.At(0));
         var o = TypeConverter.ToObject(_realm, arguments.At(0));
         var keys = o.GetOwnPropertyKeys(Types.Symbol);
         var keys = o.GetOwnPropertyKeys(Types.Symbol);
@@ -293,7 +293,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.create
     /// https://tc39.es/ecma262/#sec-object.create
     /// </summary>
     /// </summary>
-    private JsValue Create(JsValue thisObject, JsValue[] arguments)
+    private JsValue Create(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var prototype = arguments.At(0);
         var prototype = arguments.At(0);
         if (!prototype.IsObject() && !prototype.IsNull())
         if (!prototype.IsObject() && !prototype.IsNull())
@@ -316,7 +316,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.defineproperty
     /// https://tc39.es/ecma262/#sec-object.defineproperty
     /// </summary>
     /// </summary>
-    private JsValue DefineProperty(JsValue thisObject, JsValue[] arguments)
+    private JsValue DefineProperty(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (arguments.At(0) is not ObjectInstance o)
         if (arguments.At(0) is not ObjectInstance o)
         {
         {
@@ -338,7 +338,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.defineproperties
     /// https://tc39.es/ecma262/#sec-object.defineproperties
     /// </summary>
     /// </summary>
-    private JsValue DefineProperties(JsValue thisObject, JsValue[] arguments)
+    private JsValue DefineProperties(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = arguments.At(0) as ObjectInstance;
         var o = arguments.At(0) as ObjectInstance;
         if (o is null)
         if (o is null)
@@ -383,7 +383,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.seal
     /// https://tc39.es/ecma262/#sec-object.seal
     /// </summary>
     /// </summary>
-    private JsValue Seal(JsValue thisObject, JsValue[] arguments)
+    private JsValue Seal(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (arguments.At(0) is not ObjectInstance o)
         if (arguments.At(0) is not ObjectInstance o)
         {
         {
@@ -403,7 +403,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.freeze
     /// https://tc39.es/ecma262/#sec-object.freeze
     /// </summary>
     /// </summary>
-    private JsValue Freeze(JsValue thisObject, JsValue[] arguments)
+    private JsValue Freeze(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (arguments.At(0) is not ObjectInstance o)
         if (arguments.At(0) is not ObjectInstance o)
         {
         {
@@ -423,7 +423,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.preventextensions
     /// https://tc39.es/ecma262/#sec-object.preventextensions
     /// </summary>
     /// </summary>
-    private JsValue PreventExtensions(JsValue thisObject, JsValue[] arguments)
+    private JsValue PreventExtensions(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (arguments.At(0) is not ObjectInstance o)
         if (arguments.At(0) is not ObjectInstance o)
         {
         {
@@ -441,7 +441,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.issealed
     /// https://tc39.es/ecma262/#sec-object.issealed
     /// </summary>
     /// </summary>
-    private static JsValue IsSealed(JsValue thisObject, JsValue[] arguments)
+    private static JsValue IsSealed(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (arguments.At(0) is not ObjectInstance o)
         if (arguments.At(0) is not ObjectInstance o)
         {
         {
@@ -454,7 +454,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.isfrozen
     /// https://tc39.es/ecma262/#sec-object.isfrozen
     /// </summary>
     /// </summary>
-    private static JsValue IsFrozen(JsValue thisObject, JsValue[] arguments)
+    private static JsValue IsFrozen(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (arguments.At(0) is not ObjectInstance o)
         if (arguments.At(0) is not ObjectInstance o)
         {
         {
@@ -500,7 +500,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.isextensible
     /// https://tc39.es/ecma262/#sec-object.isextensible
     /// </summary>
     /// </summary>
-    private static JsValue IsExtensible(JsValue thisObject, JsValue[] arguments)
+    private static JsValue IsExtensible(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (arguments.At(0) is not ObjectInstance o)
         if (arguments.At(0) is not ObjectInstance o)
         {
         {
@@ -513,7 +513,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.keys
     /// https://tc39.es/ecma262/#sec-object.keys
     /// </summary>
     /// </summary>
-    private JsValue Keys(JsValue thisObject, JsValue[] arguments)
+    private JsValue Keys(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = TypeConverter.ToObject(_realm, arguments.At(0));
         var o = TypeConverter.ToObject(_realm, arguments.At(0));
         return o.EnumerableOwnProperties(EnumerableOwnPropertyNamesKind.Key);
         return o.EnumerableOwnProperties(EnumerableOwnPropertyNamesKind.Key);
@@ -522,7 +522,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.values
     /// https://tc39.es/ecma262/#sec-object.values
     /// </summary>
     /// </summary>
-    private JsValue Values(JsValue thisObject, JsValue[] arguments)
+    private JsValue Values(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = TypeConverter.ToObject(_realm, arguments.At(0));
         var o = TypeConverter.ToObject(_realm, arguments.At(0));
         return o.EnumerableOwnProperties(EnumerableOwnPropertyNamesKind.Value);
         return o.EnumerableOwnProperties(EnumerableOwnPropertyNamesKind.Value);
@@ -531,7 +531,7 @@ public sealed class ObjectConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/proposal-array-grouping/#sec-object.groupby
     /// https://tc39.es/proposal-array-grouping/#sec-object.groupby
     /// </summary>
     /// </summary>
-    private JsValue GroupBy(JsValue thisObject, JsValue[] arguments)
+    private JsValue GroupBy(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var items = arguments.At(0);
         var items = arguments.At(0);
         var callbackfn = arguments.At(1);
         var callbackfn = arguments.At(1);
@@ -554,7 +554,7 @@ public sealed class ObjectConstructor : Constructor
         {
         {
         }
         }
 
 
-        public JsValue Call(JsValue thisObject, params JsValue[] arguments)
+        public JsValue Call(JsValue thisObject, params JsCallArguments arguments)
         {
         {
             var o = (ObjectInstance) thisObject;
             var o = (ObjectInstance) thisObject;
             var key = arguments.At(0);
             var key = arguments.At(0);

+ 1 - 1
Jint/Native/Object/ObjectInstance.Private.cs

@@ -122,7 +122,7 @@ public partial class ObjectInstance
                 ExceptionHelper.ThrowTypeError(_engine.Realm, $"'#{property}' was defined without a setter");
                 ExceptionHelper.ThrowTypeError(_engine.Realm, $"'#{property}' was defined without a setter");
             }
             }
 
 
-            _engine.Call(setter, this, new[] { value });
+            _engine.Call(setter, this, [value]);
         }
         }
     }
     }
 
 

+ 19 - 10
Jint/Native/Object/ObjectInstance.cs

@@ -97,13 +97,23 @@ public partial class ObjectInstance : JsValue, IEquatable<ObjectInstance>
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-construct
     /// https://tc39.es/ecma262/#sec-construct
     /// </summary>
     /// </summary>
-    internal static ObjectInstance Construct(IConstructor f, JsValue[]? argumentsList = null, IConstructor? newTarget = null)
+    internal static ObjectInstance Construct(IConstructor f, IConstructor? newTarget, JsCallArguments argumentsList)
     {
     {
         newTarget ??= f;
         newTarget ??= f;
-        argumentsList ??= System.Array.Empty<JsValue>();
         return f.Construct(argumentsList, (JsValue) newTarget);
         return f.Construct(argumentsList, (JsValue) newTarget);
     }
     }
 
 
+    internal static ObjectInstance Construct(IConstructor f, JsCallArguments argumentsList)
+    {
+        return f.Construct(argumentsList, (JsValue) f);
+    }
+
+    internal static ObjectInstance Construct(IConstructor f)
+    {
+        return f.Construct([], (JsValue) f);
+    }
+
+
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-speciesconstructor
     /// https://tc39.es/ecma262/#sec-speciesconstructor
     /// </summary>
     /// </summary>
@@ -317,7 +327,7 @@ public partial class ObjectInstance : JsValue, IEquatable<ObjectInstance>
         return keys;
         return keys;
     }
     }
 
 
-    internal virtual IEnumerable<JsValue> GetInitialOwnStringPropertyKeys() => System.Linq.Enumerable.Empty<JsValue>();
+    internal virtual IEnumerable<JsValue> GetInitialOwnStringPropertyKeys() => [];
 
 
     protected virtual bool TryGetProperty(JsValue property, [NotNullWhen(true)] out PropertyDescriptor? descriptor)
     protected virtual bool TryGetProperty(JsValue property, [NotNullWhen(true)] out PropertyDescriptor? descriptor)
     {
     {
@@ -586,10 +596,9 @@ public partial class ObjectInstance : JsValue, IEquatable<ObjectInstance>
             return false;
             return false;
         }
         }
 
 
-        _engine.Call(setter, receiver, new[]
-        {
+        _engine.Call(setter, receiver, [
             value
             value
-        }, expression: null);
+        ], expression: null);
 
 
         return true;
         return true;
     }
     }
@@ -981,7 +990,7 @@ public partial class ObjectInstance : JsValue, IEquatable<ObjectInstance>
             case ObjectClass.Boolean:
             case ObjectClass.Boolean:
                 if (this is BooleanInstance booleanInstance)
                 if (this is BooleanInstance booleanInstance)
                 {
                 {
-                    converted = ((JsBoolean) booleanInstance.BooleanData)._value
+                    converted = booleanInstance.BooleanData._value
                         ? JsBoolean.BoxedTrue
                         ? JsBoolean.BoxedTrue
                         : JsBoolean.BoxedFalse;
                         : JsBoolean.BoxedFalse;
                 }
                 }
@@ -990,7 +999,7 @@ public partial class ObjectInstance : JsValue, IEquatable<ObjectInstance>
             case ObjectClass.Function:
             case ObjectClass.Function:
                 if (this is ICallable function)
                 if (this is ICallable function)
                 {
                 {
-                    converted = (Func<JsValue, JsValue[], JsValue>) function.Call;
+                    converted = (JsCallDelegate) function.Call;
                 }
                 }
 
 
                 break;
                 break;
@@ -1113,7 +1122,7 @@ public partial class ObjectInstance : JsValue, IEquatable<ObjectInstance>
     /// Handles the generic find of (callback[, thisArg])
     /// Handles the generic find of (callback[, thisArg])
     /// </summary>
     /// </summary>
     internal virtual bool FindWithCallback(
     internal virtual bool FindWithCallback(
-        JsValue[] arguments,
+        JsCallArguments arguments,
         out ulong index,
         out ulong index,
         out JsValue value,
         out JsValue value,
         bool visitUnassigned,
         bool visitUnassigned,
@@ -1563,7 +1572,7 @@ public partial class ObjectInstance : JsValue, IEquatable<ObjectInstance>
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-invoke
     /// https://tc39.es/ecma262/#sec-invoke
     /// </summary>
     /// </summary>
-    internal JsValue Invoke(JsValue v, JsValue p, JsValue[] arguments)
+    internal JsValue Invoke(JsValue v, JsValue p, JsCallArguments arguments)
     {
     {
         var func = v.GetV(_engine.Realm, p);
         var func = v.GetV(_engine.Realm, p);
         if (func is not ICallable callable)
         if (func is not ICallable callable)

+ 11 - 11
Jint/Native/Object/ObjectPrototype.cs

@@ -92,7 +92,7 @@ public sealed class ObjectPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.prototype.__defineGetter__
     /// https://tc39.es/ecma262/#sec-object.prototype.__defineGetter__
     /// </summary>
     /// </summary>
-    private JsValue DefineGetter(JsValue thisObject, JsValue[] arguments)
+    private JsValue DefineGetter(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = TypeConverter.ToObject(_realm, thisObject);
         var o = TypeConverter.ToObject(_realm, thisObject);
         var p = arguments.At(0);
         var p = arguments.At(0);
@@ -113,7 +113,7 @@ public sealed class ObjectPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.prototype.__defineSetter__
     /// https://tc39.es/ecma262/#sec-object.prototype.__defineSetter__
     /// </summary>
     /// </summary>
-    private JsValue DefineSetter(JsValue thisObject, JsValue[] arguments)
+    private JsValue DefineSetter(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = TypeConverter.ToObject(_realm, thisObject);
         var o = TypeConverter.ToObject(_realm, thisObject);
         var p = arguments.At(0);
         var p = arguments.At(0);
@@ -134,7 +134,7 @@ public sealed class ObjectPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.prototype.__lookupGetter__
     /// https://tc39.es/ecma262/#sec-object.prototype.__lookupGetter__
     /// </summary>
     /// </summary>
-    private JsValue LookupGetter(JsValue thisObject, JsValue[] arguments)
+    private JsValue LookupGetter(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = TypeConverter.ToObject(_realm, thisObject);
         var o = TypeConverter.ToObject(_realm, thisObject);
         var key = TypeConverter.ToPropertyKey(arguments.At(0));
         var key = TypeConverter.ToPropertyKey(arguments.At(0));
@@ -162,7 +162,7 @@ public sealed class ObjectPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.prototype.__lookupSetter__
     /// https://tc39.es/ecma262/#sec-object.prototype.__lookupSetter__
     /// </summary>
     /// </summary>
-    private JsValue LookupSetter(JsValue thisObject, JsValue[] arguments)
+    private JsValue LookupSetter(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = TypeConverter.ToObject(_realm, thisObject);
         var o = TypeConverter.ToObject(_realm, thisObject);
         var key = TypeConverter.ToPropertyKey(arguments.At(0));
         var key = TypeConverter.ToPropertyKey(arguments.At(0));
@@ -187,7 +187,7 @@ public sealed class ObjectPrototype : Prototype
         }
         }
     }
     }
 
 
-    private JsValue PropertyIsEnumerable(JsValue thisObject, JsValue[] arguments)
+    private JsValue PropertyIsEnumerable(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var p = TypeConverter.ToPropertyKey(arguments[0]);
         var p = TypeConverter.ToPropertyKey(arguments[0]);
         var o = TypeConverter.ToObject(_realm, thisObject);
         var o = TypeConverter.ToObject(_realm, thisObject);
@@ -199,13 +199,13 @@ public sealed class ObjectPrototype : Prototype
         return desc.Enumerable;
         return desc.Enumerable;
     }
     }
 
 
-    private JsValue ValueOf(JsValue thisObject, JsValue[] arguments)
+    private JsValue ValueOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = TypeConverter.ToObject(_realm, thisObject);
         var o = TypeConverter.ToObject(_realm, thisObject);
         return o;
         return o;
     }
     }
 
 
-    private JsValue IsPrototypeOf(JsValue thisObject, JsValue[] arguments)
+    private JsValue IsPrototypeOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var arg = arguments[0];
         var arg = arguments[0];
         if (!arg.IsObject())
         if (!arg.IsObject())
@@ -235,15 +235,15 @@ public sealed class ObjectPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.prototype.tolocalestring
     /// https://tc39.es/ecma262/#sec-object.prototype.tolocalestring
     /// </summary>
     /// </summary>
-    private JsValue ToLocaleString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToLocaleString(JsValue thisObject, JsCallArguments arguments)
     {
     {
-        return Invoke(thisObject, "toString", System.Array.Empty<JsValue>());
+        return Invoke(thisObject, "toString", []);
     }
     }
 
 
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-object.prototype.tostring
     /// https://tc39.es/ecma262/#sec-object.prototype.tostring
     /// </summary>
     /// </summary>
-    internal JsValue ToObjectString(JsValue thisObject, JsValue[] arguments)
+    internal JsValue ToObjectString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (thisObject.IsUndefined())
         if (thisObject.IsUndefined())
         {
         {
@@ -281,7 +281,7 @@ public sealed class ObjectPrototype : Prototype
     /// <summary>
     /// <summary>
     /// http://www.ecma-international.org/ecma-262/5.1/#sec-15.2.4.5
     /// http://www.ecma-international.org/ecma-262/5.1/#sec-15.2.4.5
     /// </summary>
     /// </summary>
-    private JsValue HasOwnProperty(JsValue thisObject, JsValue[] arguments)
+    private JsValue HasOwnProperty(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var p = TypeConverter.ToPropertyKey(arguments[0]);
         var p = TypeConverter.ToPropertyKey(arguments[0]);
         var o = TypeConverter.ToObject(_realm, thisObject);
         var o = TypeConverter.ToObject(_realm, thisObject);

+ 39 - 39
Jint/Native/Promise/PromiseConstructor.cs

@@ -64,7 +64,7 @@ internal sealed class PromiseConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-promise-executor
     /// https://tc39.es/ecma262/#sec-promise-executor
     /// </summary>
     /// </summary>
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         if (newTarget.IsUndefined())
         if (newTarget.IsUndefined())
         {
         {
@@ -85,11 +85,11 @@ internal sealed class PromiseConstructor : Constructor
         var (resolve, reject) = promise.CreateResolvingFunctions();
         var (resolve, reject) = promise.CreateResolvingFunctions();
         try
         try
         {
         {
-            executor.Call(Undefined, new JsValue[] { resolve, reject });
+            executor.Call(Undefined, resolve, reject);
         }
         }
         catch (JavaScriptException e)
         catch (JavaScriptException e)
         {
         {
-            reject.Call(JsValue.Undefined, new[] { e.Error });
+            reject.Call(JsValue.Undefined, [e.Error]);
         }
         }
 
 
         return promise;
         return promise;
@@ -98,7 +98,7 @@ internal sealed class PromiseConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-promise.resolve
     /// https://tc39.es/ecma262/#sec-promise.resolve
     /// </summary>
     /// </summary>
-    internal JsValue Resolve(JsValue thisObject, JsValue[] arguments)
+    internal JsValue Resolve(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (!thisObject.IsObject())
         if (!thisObject.IsObject())
         {
         {
@@ -114,7 +114,7 @@ internal sealed class PromiseConstructor : Constructor
         return PromiseResolve(thisObject, x);
         return PromiseResolve(thisObject, x);
     }
     }
 
 
-    private JsObject WithResolvers(JsValue thisObject, JsValue[] arguments)
+    private JsObject WithResolvers(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var promiseCapability = NewPromiseCapability(_engine, thisObject);
         var promiseCapability = NewPromiseCapability(_engine, thisObject);
         var obj = OrdinaryObjectCreate(_engine, _engine.Realm.Intrinsics.Object.PrototypeObject);
         var obj = OrdinaryObjectCreate(_engine, _engine.Realm.Intrinsics.Object.PrototypeObject);
@@ -140,7 +140,7 @@ internal sealed class PromiseConstructor : Constructor
 
 
         var capability = NewPromiseCapability(_engine, thisObject);
         var capability = NewPromiseCapability(_engine, thisObject);
 
 
-        capability.Resolve.Call(Undefined, new[] { x });
+        capability.Resolve.Call(Undefined, x);
 
 
         return capability.PromiseInstance;
         return capability.PromiseInstance;
     }
     }
@@ -148,7 +148,7 @@ internal sealed class PromiseConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-promise.reject
     /// https://tc39.es/ecma262/#sec-promise.reject
     /// </summary>
     /// </summary>
-    private JsValue Reject(JsValue thisObject, JsValue[] arguments)
+    private JsValue Reject(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (!thisObject.IsObject())
         if (!thisObject.IsObject())
         {
         {
@@ -164,7 +164,7 @@ internal sealed class PromiseConstructor : Constructor
 
 
         var capability = NewPromiseCapability(_engine, thisObject);
         var capability = NewPromiseCapability(_engine, thisObject);
 
 
-        capability.Reject.Call(Undefined, new[] { r });
+        capability.Reject.Call(Undefined, r);
 
 
         return capability.PromiseInstance;
         return capability.PromiseInstance;
     }
     }
@@ -172,7 +172,7 @@ internal sealed class PromiseConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/proposal-promise-try/
     /// https://tc39.es/proposal-promise-try/
     /// </summary>
     /// </summary>
-    private JsValue Try(JsValue thisObject, JsValue[] arguments)
+    private JsValue Try(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (!thisObject.IsObject())
         if (!thisObject.IsObject())
         {
         {
@@ -184,12 +184,12 @@ internal sealed class PromiseConstructor : Constructor
 
 
         try
         try
         {
         {
-            var status = callbackfn.Call(Undefined, arguments.Skip(1));
-            promiseCapability.Resolve.Call(Undefined, new[] { status });
+            var status = callbackfn.Call(Undefined, arguments.AsSpan().Slice(1).ToArray());
+            promiseCapability.Resolve.Call(Undefined, status);
         }
         }
         catch (JavaScriptException e)
         catch (JavaScriptException e)
         {
         {
-            promiseCapability.Reject.Call(Undefined, new[] { e.Error });
+            promiseCapability.Reject.Call(Undefined, e.Error);
         }
         }
 
 
         return promiseCapability.PromiseInstance;
         return promiseCapability.PromiseInstance;
@@ -198,7 +198,7 @@ internal sealed class PromiseConstructor : Constructor
     // This helper methods executes the first 6 steps in the specs belonging to static Promise methods like all, any etc.
     // This helper methods executes the first 6 steps in the specs belonging to static Promise methods like all, any etc.
     // If it returns false, that means it has an error and it is already rejected
     // If it returns false, that means it has an error and it is already rejected
     // If it returns true, the logic specific to the calling function should continue executing
     // If it returns true, the logic specific to the calling function should continue executing
-    private bool TryGetPromiseCapabilityAndIterator(JsValue thisObject, JsValue[] arguments, string callerName, out PromiseCapability capability, out ICallable promiseResolve, out IteratorInstance iterator)
+    private bool TryGetPromiseCapabilityAndIterator(JsValue thisObject, JsCallArguments arguments, string callerName, out PromiseCapability capability, out ICallable promiseResolve, out IteratorInstance iterator)
     {
     {
         if (!thisObject.IsObject())
         if (!thisObject.IsObject())
         {
         {
@@ -217,7 +217,7 @@ internal sealed class PromiseConstructor : Constructor
         }
         }
         catch (JavaScriptException e)
         catch (JavaScriptException e)
         {
         {
-            reject.Call(Undefined, new[] { e.Error });
+            reject.Call(Undefined, e.Error);
             promiseResolve = null!;
             promiseResolve = null!;
             iterator = null!;
             iterator = null!;
             return false;
             return false;
@@ -240,7 +240,7 @@ internal sealed class PromiseConstructor : Constructor
         }
         }
         catch (JavaScriptException e)
         catch (JavaScriptException e)
         {
         {
-            reject.Call(Undefined, new[] { e.Error });
+            reject.Call(Undefined, e.Error);
             iterator = null!;
             iterator = null!;
             return false;
             return false;
         }
         }
@@ -249,7 +249,7 @@ internal sealed class PromiseConstructor : Constructor
     }
     }
 
 
     // https://tc39.es/ecma262/#sec-promise.all
     // https://tc39.es/ecma262/#sec-promise.all
-    private JsValue All(JsValue thisObject, JsValue[] arguments)
+    private JsValue All(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (!TryGetPromiseCapabilityAndIterator(thisObject, arguments, "Promise.all", out var capability, out var promiseResolve, out var iterator))
         if (!TryGetPromiseCapabilityAndIterator(thisObject, arguments, "Promise.all", out var capability, out var promiseResolve, out var iterator))
             return capability.PromiseInstance;
             return capability.PromiseInstance;
@@ -266,7 +266,7 @@ internal sealed class PromiseConstructor : Constructor
             if (results.TrueForAll(static x => x is not null) && doneIterating)
             if (results.TrueForAll(static x => x is not null) && doneIterating)
             {
             {
                 var array = _realm.Intrinsics.Array.ConstructFast(results);
                 var array = _realm.Intrinsics.Array.ConstructFast(results);
-                capability.Resolve.Call(Undefined, new JsValue[] { array });
+                capability.Resolve.Call(Undefined, array);
             }
             }
         }
         }
 
 
@@ -293,7 +293,7 @@ internal sealed class PromiseConstructor : Constructor
                 }
                 }
                 catch (JavaScriptException e)
                 catch (JavaScriptException e)
                 {
                 {
-                    capability.Reject.Call(Undefined, new[] { e.Error });
+                    capability.Reject.Call(Undefined, e.Error);
                     return capability.PromiseInstance;
                     return capability.PromiseInstance;
                 }
                 }
 
 
@@ -302,7 +302,7 @@ internal sealed class PromiseConstructor : Constructor
                 // In F# it would be Option<JsValue>
                 // In F# it would be Option<JsValue>
                 results.Add(null!);
                 results.Add(null!);
 
 
-                var item = promiseResolve.Call(thisObject, new JsValue[] { value });
+                var item = promiseResolve.Call(thisObject, value);
                 var thenProps = item.Get("then");
                 var thenProps = item.Get("then");
                 if (thenProps is ICallable thenFunc)
                 if (thenProps is ICallable thenFunc)
                 {
                 {
@@ -322,7 +322,7 @@ internal sealed class PromiseConstructor : Constructor
                             return Undefined;
                             return Undefined;
                         }, 1, PropertyFlag.Configurable);
                         }, 1, PropertyFlag.Configurable);
 
 
-                    thenFunc.Call(item, new JsValue[] { onSuccess, capability.RejectObj });
+                    thenFunc.Call(item, onSuccess, capability.RejectObj);
                 }
                 }
                 else
                 else
                 {
                 {
@@ -335,7 +335,7 @@ internal sealed class PromiseConstructor : Constructor
         catch (JavaScriptException e)
         catch (JavaScriptException e)
         {
         {
             iterator.Close(CompletionType.Throw);
             iterator.Close(CompletionType.Throw);
-            capability.Reject.Call(Undefined, new[] { e.Error });
+            capability.Reject.Call(Undefined, e.Error);
             return capability.PromiseInstance;
             return capability.PromiseInstance;
         }
         }
 
 
@@ -343,7 +343,7 @@ internal sealed class PromiseConstructor : Constructor
     }
     }
 
 
     // https://tc39.es/ecma262/#sec-promise.allsettled
     // https://tc39.es/ecma262/#sec-promise.allsettled
-    private JsValue AllSettled(JsValue thisObject, JsValue[] arguments)
+    private JsValue AllSettled(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (!TryGetPromiseCapabilityAndIterator(thisObject, arguments, "Promise.allSettled", out var capability, out var promiseResolve, out var iterator))
         if (!TryGetPromiseCapabilityAndIterator(thisObject, arguments, "Promise.allSettled", out var capability, out var promiseResolve, out var iterator))
             return capability.PromiseInstance;
             return capability.PromiseInstance;
@@ -360,7 +360,7 @@ internal sealed class PromiseConstructor : Constructor
             if (results.TrueForAll(static x => x is not null) && doneIterating)
             if (results.TrueForAll(static x => x is not null) && doneIterating)
             {
             {
                 var array = _realm.Intrinsics.Array.ConstructFast(results);
                 var array = _realm.Intrinsics.Array.ConstructFast(results);
-                capability.Resolve.Call(Undefined, new JsValue[] { array });
+                capability.Resolve.Call(Undefined, array);
             }
             }
         }
         }
 
 
@@ -387,7 +387,7 @@ internal sealed class PromiseConstructor : Constructor
                 }
                 }
                 catch (JavaScriptException e)
                 catch (JavaScriptException e)
                 {
                 {
-                    capability.Reject.Call(Undefined, new[] { e.Error });
+                    capability.Reject.Call(Undefined, e.Error);
                     return capability.PromiseInstance;
                     return capability.PromiseInstance;
                 }
                 }
 
 
@@ -396,7 +396,7 @@ internal sealed class PromiseConstructor : Constructor
                 // In F# it would be Option<JsValue>
                 // In F# it would be Option<JsValue>
                 results.Add(null!);
                 results.Add(null!);
 
 
-                var item = promiseResolve.Call(thisObject, new JsValue[] { value });
+                var item = promiseResolve.Call(thisObject, value);
                 var thenProps = item.Get("then");
                 var thenProps = item.Get("then");
                 if (thenProps is ICallable thenFunc)
                 if (thenProps is ICallable thenFunc)
                 {
                 {
@@ -438,7 +438,7 @@ internal sealed class PromiseConstructor : Constructor
                             return Undefined;
                             return Undefined;
                         }, 1, PropertyFlag.Configurable);
                         }, 1, PropertyFlag.Configurable);
 
 
-                    thenFunc.Call(item, new JsValue[] { onSuccess, onFailure });
+                    thenFunc.Call(item, onSuccess, onFailure);
                 }
                 }
                 else
                 else
                 {
                 {
@@ -451,7 +451,7 @@ internal sealed class PromiseConstructor : Constructor
         catch (JavaScriptException e)
         catch (JavaScriptException e)
         {
         {
             iterator.Close(CompletionType.Throw);
             iterator.Close(CompletionType.Throw);
-            capability.Reject.Call(Undefined, new[] { e.Error });
+            capability.Reject.Call(Undefined, e.Error);
             return capability.PromiseInstance;
             return capability.PromiseInstance;
         }
         }
 
 
@@ -459,7 +459,7 @@ internal sealed class PromiseConstructor : Constructor
     }
     }
 
 
     // https://tc39.es/ecma262/#sec-promise.any
     // https://tc39.es/ecma262/#sec-promise.any
-    private JsValue Any(JsValue thisObject, JsValue[] arguments)
+    private JsValue Any(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (!TryGetPromiseCapabilityAndIterator(thisObject, arguments, "Promise.any", out var capability, out var promiseResolve, out var iterator))
         if (!TryGetPromiseCapabilityAndIterator(thisObject, arguments, "Promise.any", out var capability, out var promiseResolve, out var iterator))
         {
         {
@@ -480,7 +480,7 @@ internal sealed class PromiseConstructor : Constructor
             {
             {
                 var array = _realm.Intrinsics.Array.ConstructFast(errors);
                 var array = _realm.Intrinsics.Array.ConstructFast(errors);
 
 
-                capability.Reject.Call(Undefined, new JsValue[] { Construct(_realm.Intrinsics.AggregateError, new JsValue[] { array }) });
+                capability.Reject.Call(Undefined, Construct(_realm.Intrinsics.AggregateError, [array]));
             }
             }
         }
         }
 
 
@@ -519,7 +519,7 @@ internal sealed class PromiseConstructor : Constructor
                 // In F# it would be Option<JsValue>
                 // In F# it would be Option<JsValue>
                 errors.Add(null!);
                 errors.Add(null!);
 
 
-                var item = promiseResolve.Call(thisObject, new JsValue[] { value });
+                var item = promiseResolve.Call(thisObject, value);
                 var thenProps = item.Get("then");
                 var thenProps = item.Get("then");
                 if (thenProps is ICallable thenFunc)
                 if (thenProps is ICallable thenFunc)
                 {
                 {
@@ -540,7 +540,7 @@ internal sealed class PromiseConstructor : Constructor
                             return Undefined;
                             return Undefined;
                         }, 1, PropertyFlag.Configurable);
                         }, 1, PropertyFlag.Configurable);
 
 
-                    thenFunc.Call(item, new JsValue[] { capability.ResolveObj, onError });
+                    thenFunc.Call(item, capability.ResolveObj, onError);
                 }
                 }
                 else
                 else
                 {
                 {
@@ -553,7 +553,7 @@ internal sealed class PromiseConstructor : Constructor
         catch (JavaScriptException e)
         catch (JavaScriptException e)
         {
         {
             iterator.Close(CompletionType.Throw);
             iterator.Close(CompletionType.Throw);
-            capability.Reject.Call(Undefined, new[] { e.Error });
+            capability.Reject.Call(Undefined, e.Error);
             return capability.PromiseInstance;
             return capability.PromiseInstance;
         }
         }
 
 
@@ -561,7 +561,7 @@ internal sealed class PromiseConstructor : Constructor
     }
     }
 
 
     // https://tc39.es/ecma262/#sec-promise.race
     // https://tc39.es/ecma262/#sec-promise.race
-    private JsValue Race(JsValue thisObject, JsValue[] arguments)
+    private JsValue Race(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (!TryGetPromiseCapabilityAndIterator(thisObject, arguments, "Promise.race", out var capability, out var promiseResolve, out var iterator))
         if (!TryGetPromiseCapabilityAndIterator(thisObject, arguments, "Promise.race", out var capability, out var promiseResolve, out var iterator))
             return capability.PromiseInstance;
             return capability.PromiseInstance;
@@ -584,16 +584,16 @@ internal sealed class PromiseConstructor : Constructor
                 }
                 }
                 catch (JavaScriptException e)
                 catch (JavaScriptException e)
                 {
                 {
-                    capability.Reject.Call(Undefined, new[] { e.Error });
+                    capability.Reject.Call(Undefined, e.Error);
                     return capability.PromiseInstance;
                     return capability.PromiseInstance;
                 }
                 }
 
 
                 // h. Let nextPromise be ? Call(promiseResolve, constructor, « nextValue »).
                 // h. Let nextPromise be ? Call(promiseResolve, constructor, « nextValue »).
-                var nextPromise = promiseResolve.Call(thisObject, new JsValue[] { nextValue });
+                var nextPromise = promiseResolve.Call(thisObject, nextValue);
 
 
                 // i. Perform ? Invoke(nextPromise, "then", « resultCapability.[[Resolve]], resultCapability.[[Reject]] »).
                 // i. Perform ? Invoke(nextPromise, "then", « resultCapability.[[Resolve]], resultCapability.[[Reject]] »).
 
 
-                _engine.Invoke(nextPromise, "then", new[] { (JsValue) capability.Resolve, capability.RejectObj });
+                _engine.Invoke(nextPromise, "then", [(JsValue) capability.Resolve, capability.RejectObj]);
             } while (true);
             } while (true);
         }
         }
         catch (JavaScriptException e)
         catch (JavaScriptException e)
@@ -602,7 +602,7 @@ internal sealed class PromiseConstructor : Constructor
             // a. If iteratorRecord.[[Done]] is false, set result to IteratorClose(iteratorRecord, result).
             // a. If iteratorRecord.[[Done]] is false, set result to IteratorClose(iteratorRecord, result).
             //     b. IfAbruptRejectPromise(result, promiseCapability).
             //     b. IfAbruptRejectPromise(result, promiseCapability).
             iterator.Close(CompletionType.Throw);
             iterator.Close(CompletionType.Throw);
-            capability.Reject.Call(Undefined, new[] { e.Error });
+            capability.Reject.Call(Undefined, e.Error);
             return capability.PromiseInstance;
             return capability.PromiseInstance;
         }
         }
 
 
@@ -661,7 +661,7 @@ internal sealed class PromiseConstructor : Constructor
         JsValue? resolveArg = null;
         JsValue? resolveArg = null;
         JsValue? rejectArg = null;
         JsValue? rejectArg = null;
 
 
-        JsValue Executor(JsValue thisObject, JsValue[] arguments)
+        JsValue Executor(JsValue thisObject, JsCallArguments arguments)
         {
         {
             // 25.4.1.5.1 GetCapabilitiesExecutor Functions
             // 25.4.1.5.1 GetCapabilitiesExecutor Functions
             // 3. If promiseCapability.[[Resolve]] is not undefined, throw a TypeError exception.
             // 3. If promiseCapability.[[Resolve]] is not undefined, throw a TypeError exception.
@@ -682,7 +682,7 @@ internal sealed class PromiseConstructor : Constructor
 
 
         var executor = new ClrFunction(engine, "", Executor, 2, PropertyFlag.Configurable);
         var executor = new ClrFunction(engine, "", Executor, 2, PropertyFlag.Configurable);
 
 
-        var instance = ctor.Construct(new JsValue[] { executor }, c);
+        var instance = ctor.Construct([executor], c);
 
 
         ICallable? resolve = null;
         ICallable? resolve = null;
         ICallable? reject = null;
         ICallable? reject = null;

+ 7 - 7
Jint/Native/Promise/PromiseOperations.cs

@@ -37,12 +37,12 @@ internal static class PromiseOperations
             {
             {
                 try
                 try
                 {
                 {
-                    var result = handler.Call(JsValue.Undefined, new[] {value});
-                    promiseCapability.Resolve.Call(JsValue.Undefined, new[] {result});
+                    var result = handler.Call(JsValue.Undefined, value);
+                    promiseCapability.Resolve.Call(JsValue.Undefined, result);
                 }
                 }
                 catch (JavaScriptException e)
                 catch (JavaScriptException e)
                 {
                 {
-                    promiseCapability.Reject.Call(JsValue.Undefined, new[] {e.Error});
+                    promiseCapability.Reject.Call(JsValue.Undefined, e.Error);
                 }
                 }
             }
             }
             else
             else
@@ -50,11 +50,11 @@ internal static class PromiseOperations
                 switch (reaction.Type)
                 switch (reaction.Type)
                 {
                 {
                     case ReactionType.Fulfill:
                     case ReactionType.Fulfill:
-                        promiseCapability.Resolve.Call(JsValue.Undefined, new[] {value});
+                        promiseCapability.Resolve.Call(JsValue.Undefined, value);
                         break;
                         break;
 
 
                     case ReactionType.Reject:
                     case ReactionType.Reject:
-                        promiseCapability.Reject.Call(JsValue.Undefined, new[] {value});
+                        promiseCapability.Reject.Call(JsValue.Undefined, value);
                         break;
                         break;
 
 
                     default:
                     default:
@@ -86,11 +86,11 @@ internal static class PromiseOperations
 
 
             try
             try
             {
             {
-                thenMethod.Call(thenable, new[] { resolve as JsValue, reject });
+                thenMethod.Call(thenable, resolve as JsValue, reject);
             }
             }
             catch (JavaScriptException e)
             catch (JavaScriptException e)
             {
             {
-                reject.Call(JsValue.Undefined, new[] { e.Error });
+                reject.Call(JsValue.Undefined, [e.Error]);
             }
             }
         };
         };
     }
     }

+ 8 - 8
Jint/Native/Promise/PromisePrototype.cs

@@ -50,7 +50,7 @@ internal sealed class PromisePrototype : Prototype
     // 3. Let C be ? SpeciesConstructor(promise, %Promise%).
     // 3. Let C be ? SpeciesConstructor(promise, %Promise%).
     // 4. Let resultCapability be ? NewPromiseCapability(C).
     // 4. Let resultCapability be ? NewPromiseCapability(C).
     // 5. Return PerformPromiseThen(promise, onFulfilled, onRejected, resultCapability).
     // 5. Return PerformPromiseThen(promise, onFulfilled, onRejected, resultCapability).
-    private JsValue Then(JsValue thisValue, JsValue[] arguments)
+    private JsValue Then(JsValue thisValue, JsCallArguments arguments)
     {
     {
         // 1. Let promise be the this value.
         // 1. Let promise be the this value.
         // 2. If IsPromise(promise) is false, throw a TypeError exception.
         // 2. If IsPromise(promise) is false, throw a TypeError exception.
@@ -77,11 +77,11 @@ internal sealed class PromisePrototype : Prototype
     //
     //
     // 1. Let promise be the this value.
     // 1. Let promise be the this value.
     // 2. Return ? Invoke(promise, "then", « undefined, onRejected »).
     // 2. Return ? Invoke(promise, "then", « undefined, onRejected »).
-    private JsValue Catch(JsValue thisValue, JsValue[] arguments) =>
+    private JsValue Catch(JsValue thisValue, JsCallArguments arguments) =>
         _engine.Invoke(thisValue, "then", new[] {Undefined, arguments.At(0)});
         _engine.Invoke(thisValue, "then", new[] {Undefined, arguments.At(0)});
 
 
     // https://tc39.es/ecma262/#sec-promise.prototype.finally
     // https://tc39.es/ecma262/#sec-promise.prototype.finally
-    private JsValue Finally(JsValue thisValue, JsValue[] arguments)
+    private JsValue Finally(JsValue thisValue, JsCallArguments arguments)
     {
     {
         // 1. Let promise be the this value.
         // 1. Let promise be the this value.
         // 2. If Type(promise) is not Object, throw a TypeError exception.
         // 2. If Type(promise) is not Object, throw a TypeError exception.
@@ -114,7 +114,7 @@ internal sealed class PromisePrototype : Prototype
         }
         }
 
 
         // 7. Return ? Invoke(promise, "then", « thenFinally, catchFinally »).
         // 7. Return ? Invoke(promise, "then", « thenFinally, catchFinally »).
-        return _engine.Invoke(promise, "then", new[] {thenFinally, catchFinally});
+        return _engine.Invoke(promise, "then", [thenFinally, catchFinally]);
     }
     }
 
 
     // https://tc39.es/ecma262/#sec-thenfinallyfunctions
     // https://tc39.es/ecma262/#sec-thenfinallyfunctions
@@ -127,13 +127,13 @@ internal sealed class PromisePrototype : Prototype
             var result = onFinally.Call(Undefined, Arguments.Empty);
             var result = onFinally.Call(Undefined, Arguments.Empty);
 
 
             // 7. Let promise be ? PromiseResolve(C, result).
             // 7. Let promise be ? PromiseResolve(C, result).
-            var promise = _realm.Intrinsics.Promise.Resolve((JsValue) ctor, new[] {result});
+            var promise = _realm.Intrinsics.Promise.Resolve((JsValue) ctor, [result]);
 
 
             // 8. Let valueThunk be equivalent to a function that returns value.
             // 8. Let valueThunk be equivalent to a function that returns value.
             var valueThunk = new ClrFunction(_engine, "", (_, _) => value);
             var valueThunk = new ClrFunction(_engine, "", (_, _) => value);
 
 
             // 9. Return ? Invoke(promise, "then", « valueThunk »).
             // 9. Return ? Invoke(promise, "then", « valueThunk »).
-            return _engine.Invoke(promise, "then", new JsValue[] {valueThunk});
+            return _engine.Invoke(promise, "then", [valueThunk]);
         }, 1, PropertyFlag.Configurable);
         }, 1, PropertyFlag.Configurable);
 
 
     // https://tc39.es/ecma262/#sec-catchfinallyfunctions
     // https://tc39.es/ecma262/#sec-catchfinallyfunctions
@@ -146,12 +146,12 @@ internal sealed class PromisePrototype : Prototype
             var result = onFinally.Call(Undefined, Arguments.Empty);
             var result = onFinally.Call(Undefined, Arguments.Empty);
 
 
             // 7. Let promise be ? PromiseResolve(C, result).
             // 7. Let promise be ? PromiseResolve(C, result).
-            var promise = _realm.Intrinsics.Promise.Resolve((JsValue) ctor, new[] {result});
+            var promise = _realm.Intrinsics.Promise.Resolve((JsValue) ctor, [result]);
 
 
             // 8. Let thrower be equivalent to a function that throws reason.
             // 8. Let thrower be equivalent to a function that throws reason.
             var thrower = new ClrFunction(_engine, "", (_, _) => throw new JavaScriptException(reason));
             var thrower = new ClrFunction(_engine, "", (_, _) => throw new JavaScriptException(reason));
 
 
             // 9. Return ? Invoke(promise, "then", « thrower »).
             // 9. Return ? Invoke(promise, "then", « thrower »).
-            return _engine.Invoke(promise, "then", new JsValue[] {thrower});
+            return _engine.Invoke(promise, "then", [thrower]);
         }, 1, PropertyFlag.Configurable);
         }, 1, PropertyFlag.Configurable);
 }
 }

+ 4 - 4
Jint/Native/Proxy/ProxyConstructor.cs

@@ -34,7 +34,7 @@ internal sealed class ProxyConstructor : Constructor
         SetProperties(properties);
         SetProperties(properties);
     }
     }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         if (newTarget.IsUndefined())
         if (newTarget.IsUndefined())
         {
         {
@@ -60,18 +60,18 @@ internal sealed class ProxyConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-proxy.revocable
     /// https://tc39.es/ecma262/#sec-proxy.revocable
     /// </summary>
     /// </summary>
-    private JsValue Revocable(JsValue thisObject, JsValue[] arguments)
+    private JsValue Revocable(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var p = ProxyCreate(arguments.At(0), arguments.At(1));
         var p = ProxyCreate(arguments.At(0), arguments.At(1));
 
 
-        JsValue Revoke(JsValue thisObject, JsValue[] arguments)
+        JsValue Revoke(JsValue thisObject, JsCallArguments arguments)
         {
         {
             p._handler = null;
             p._handler = null;
             p._target = null!;
             p._target = null!;
             return Undefined;
             return Undefined;
         }
         }
 
 
-        var result = _realm.Intrinsics.Object.Construct(System.Array.Empty<JsValue>());
+        var result = _realm.Intrinsics.Object.Construct([]);
         result.DefineOwnProperty(PropertyRevoke, new PropertyDescriptor(new ClrFunction(_engine, name: "", Revoke, 0, PropertyFlag.Configurable), PropertyFlag.ConfigurableEnumerableWritable));
         result.DefineOwnProperty(PropertyRevoke, new PropertyDescriptor(new ClrFunction(_engine, name: "", Revoke, 0, PropertyFlag.Configurable), PropertyFlag.ConfigurableEnumerableWritable));
         result.DefineOwnProperty(PropertyProxy, new PropertyDescriptor(p, PropertyFlag.ConfigurableEnumerableWritable));
         result.DefineOwnProperty(PropertyProxy, new PropertyDescriptor(p, PropertyFlag.ConfigurableEnumerableWritable));
         return result;
         return result;

+ 13 - 13
Jint/Native/Reflect/ReflectInstance.cs

@@ -53,7 +53,7 @@ internal sealed class ReflectInstance : ObjectInstance
         SetSymbols(symbols);
         SetSymbols(symbols);
     }
     }
 
 
-    private JsValue Apply(JsValue thisObject, JsValue[] arguments)
+    private JsValue Apply(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var target = arguments.At(0);
         var target = arguments.At(0);
         var thisArgument = arguments.At(1);
         var thisArgument = arguments.At(1);
@@ -74,7 +74,7 @@ internal sealed class ReflectInstance : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-reflect.construct
     /// https://tc39.es/ecma262/#sec-reflect.construct
     /// </summary>
     /// </summary>
-    private JsValue Construct(JsValue thisObject, JsValue[] arguments)
+    private JsValue Construct(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var target = AssertConstructor(_engine, arguments.At(0));
         var target = AssertConstructor(_engine, arguments.At(0));
 
 
@@ -89,7 +89,7 @@ internal sealed class ReflectInstance : ObjectInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-reflect.defineproperty
     /// https://tc39.es/ecma262/#sec-reflect.defineproperty
     /// </summary>
     /// </summary>
-    private JsValue DefineProperty(JsValue thisObject, JsValue[] arguments)
+    private JsValue DefineProperty(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var target = arguments.At(0) as ObjectInstance;
         var target = arguments.At(0) as ObjectInstance;
         if (target is null)
         if (target is null)
@@ -106,7 +106,7 @@ internal sealed class ReflectInstance : ObjectInstance
         return target.DefineOwnProperty(key, desc);
         return target.DefineOwnProperty(key, desc);
     }
     }
 
 
-    private JsValue DeleteProperty(JsValue thisObject, JsValue[] arguments)
+    private JsValue DeleteProperty(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = arguments.At(0) as ObjectInstance;
         var o = arguments.At(0) as ObjectInstance;
         if (o is null)
         if (o is null)
@@ -118,7 +118,7 @@ internal sealed class ReflectInstance : ObjectInstance
         return o.Delete(property) ? JsBoolean.True : JsBoolean.False;
         return o.Delete(property) ? JsBoolean.True : JsBoolean.False;
     }
     }
 
 
-    private JsValue Has(JsValue thisObject, JsValue[] arguments)
+    private JsValue Has(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = arguments.At(0) as ObjectInstance;
         var o = arguments.At(0) as ObjectInstance;
         if (o is null)
         if (o is null)
@@ -130,7 +130,7 @@ internal sealed class ReflectInstance : ObjectInstance
         return o.HasProperty(property) ? JsBoolean.True : JsBoolean.False;
         return o.HasProperty(property) ? JsBoolean.True : JsBoolean.False;
     }
     }
 
 
-    private JsValue Set(JsValue thisObject, JsValue[] arguments)
+    private JsValue Set(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var target = arguments.At(0);
         var target = arguments.At(0);
         var property = TypeConverter.ToPropertyKey(arguments.At(1));
         var property = TypeConverter.ToPropertyKey(arguments.At(1));
@@ -146,7 +146,7 @@ internal sealed class ReflectInstance : ObjectInstance
         return o.Set(property, value, receiver);
         return o.Set(property, value, receiver);
     }
     }
 
 
-    private JsValue Get(JsValue thisObject, JsValue[] arguments)
+    private JsValue Get(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var target = arguments.At(0);
         var target = arguments.At(0);
         var o = target as ObjectInstance;
         var o = target as ObjectInstance;
@@ -160,7 +160,7 @@ internal sealed class ReflectInstance : ObjectInstance
         return o.Get(property, receiver);
         return o.Get(property, receiver);
     }
     }
 
 
-    private JsValue GetOwnPropertyDescriptor(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetOwnPropertyDescriptor(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (!arguments.At(0).IsObject())
         if (!arguments.At(0).IsObject())
         {
         {
@@ -169,7 +169,7 @@ internal sealed class ReflectInstance : ObjectInstance
         return _realm.Intrinsics.Object.GetOwnPropertyDescriptor(Undefined, arguments);
         return _realm.Intrinsics.Object.GetOwnPropertyDescriptor(Undefined, arguments);
     }
     }
 
 
-    private JsValue OwnKeys(JsValue thisObject, JsValue[] arguments)
+    private JsValue OwnKeys(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = arguments.At(0) as ObjectInstance;
         var o = arguments.At(0) as ObjectInstance;
         if (o is null)
         if (o is null)
@@ -181,7 +181,7 @@ internal sealed class ReflectInstance : ObjectInstance
         return _realm.Intrinsics.Array.CreateArrayFromList(keys);
         return _realm.Intrinsics.Array.CreateArrayFromList(keys);
     }
     }
 
 
-    private JsValue IsExtensible(JsValue thisObject, JsValue[] arguments)
+    private JsValue IsExtensible(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = arguments.At(0) as ObjectInstance;
         var o = arguments.At(0) as ObjectInstance;
         if (o is null)
         if (o is null)
@@ -192,7 +192,7 @@ internal sealed class ReflectInstance : ObjectInstance
         return o.Extensible;
         return o.Extensible;
     }
     }
 
 
-    private JsValue PreventExtensions(JsValue thisObject, JsValue[] arguments)
+    private JsValue PreventExtensions(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = arguments.At(0) as ObjectInstance;
         var o = arguments.At(0) as ObjectInstance;
         if (o is null)
         if (o is null)
@@ -203,7 +203,7 @@ internal sealed class ReflectInstance : ObjectInstance
         return o.PreventExtensions();
         return o.PreventExtensions();
     }
     }
 
 
-    private JsValue GetPrototypeOf(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetPrototypeOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var target = arguments.At(0);
         var target = arguments.At(0);
 
 
@@ -215,7 +215,7 @@ internal sealed class ReflectInstance : ObjectInstance
         return _realm.Intrinsics.Object.GetPrototypeOf(Undefined, arguments);
         return _realm.Intrinsics.Object.GetPrototypeOf(Undefined, arguments);
     }
     }
 
 
-    private JsValue SetPrototypeOf(JsValue thisObject, JsValue[] arguments)
+    private JsValue SetPrototypeOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var target = arguments.At(0);
         var target = arguments.At(0);
 
 

+ 3 - 3
Jint/Native/RegExp/RegExpConstructor.cs

@@ -37,12 +37,12 @@ public sealed class RegExpConstructor : Constructor
         SetSymbols(symbols);
         SetSymbols(symbols);
     }
     }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return Construct(arguments, thisObject);
         return Construct(arguments, thisObject);
     }
     }
 
 
-    public ObjectInstance Construct(JsValue[] arguments)
+    public ObjectInstance Construct(JsCallArguments arguments)
     {
     {
         return Construct(arguments, this);
         return Construct(arguments, this);
     }
     }
@@ -50,7 +50,7 @@ public sealed class RegExpConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-regexp-pattern-flags
     /// https://tc39.es/ecma262/#sec-regexp-pattern-flags
     /// </summary>
     /// </summary>
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var pattern = arguments.At(0);
         var pattern = arguments.At(0);
         var flags = arguments.At(1);
         var flags = arguments.At(1);

+ 18 - 20
Jint/Native/RegExp/RegExpPrototype.cs

@@ -31,7 +31,7 @@ internal sealed class RegExpPrototype : Prototype
     private static readonly JsString PropertyUnicodeSets = new("unicodeSets");
     private static readonly JsString PropertyUnicodeSets = new("unicodeSets");
 
 
     private readonly RegExpConstructor _constructor;
     private readonly RegExpConstructor _constructor;
-    private readonly Func<JsValue, JsValue[], JsValue> _defaultExec;
+    private readonly JsCallDelegate _defaultExec;
 
 
     internal RegExpPrototype(
     internal RegExpPrototype(
         Engine engine,
         Engine engine,
@@ -104,7 +104,7 @@ internal sealed class RegExpPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-get-regexp.prototype.source
     /// https://tc39.es/ecma262/#sec-get-regexp.prototype.source
     /// </summary>
     /// </summary>
-    private JsValue Source(JsValue thisObject, JsValue[] arguments)
+    private JsValue Source(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (ReferenceEquals(thisObject, this))
         if (ReferenceEquals(thisObject, this))
         {
         {
@@ -132,7 +132,7 @@ internal sealed class RegExpPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
     /// https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
     /// </summary>
     /// </summary>
-    private JsValue Replace(JsValue thisObject, JsValue[] arguments)
+    private JsValue Replace(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var rx = AssertThisIsObjectInstance(thisObject, "RegExp.prototype.replace");
         var rx = AssertThisIsObjectInstance(thisObject, "RegExp.prototype.replace");
         var s = TypeConverter.ToString(arguments.At(0));
         var s = TypeConverter.ToString(arguments.At(0));
@@ -438,7 +438,7 @@ internal sealed class RegExpPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-regexp.prototype-@@split
     /// https://tc39.es/ecma262/#sec-regexp.prototype-@@split
     /// </summary>
     /// </summary>
-    private JsValue Split(JsValue thisObject, JsValue[] arguments)
+    private JsValue Split(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var rx = AssertThisIsObjectInstance(thisObject, "RegExp.prototype.split");
         var rx = AssertThisIsObjectInstance(thisObject, "RegExp.prototype.split");
         var s = TypeConverter.ToString(arguments.At(0));
         var s = TypeConverter.ToString(arguments.At(0));
@@ -447,11 +447,10 @@ internal sealed class RegExpPrototype : Prototype
         var flags = TypeConverter.ToJsString(rx.Get(PropertyFlags));
         var flags = TypeConverter.ToJsString(rx.Get(PropertyFlags));
         var unicodeMatching = flags.Contains('u');
         var unicodeMatching = flags.Contains('u');
         var newFlags = flags.Contains('y') ? flags : new JsString(flags.ToString() + 'y');
         var newFlags = flags.Contains('y') ? flags : new JsString(flags.ToString() + 'y');
-        var splitter = Construct(c, new JsValue[]
-        {
+        var splitter = Construct(c, [
             rx,
             rx,
             newFlags
             newFlags
-        });
+        ]);
         uint lengthA = 0;
         uint lengthA = 0;
         var lim = limit.IsUndefined() ? NumberConstructor.MaxSafeInteger : TypeConverter.ToUint32(limit);
         var lim = limit.IsUndefined() ? NumberConstructor.MaxSafeInteger : TypeConverter.ToUint32(limit);
 
 
@@ -585,7 +584,7 @@ internal sealed class RegExpPrototype : Prototype
         return a;
         return a;
     }
     }
 
 
-    private JsValue Flags(JsValue thisObject, JsValue[] arguments)
+    private JsValue Flags(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var r = AssertThisIsObjectInstance(thisObject, "RegExp.prototype.flags");
         var r = AssertThisIsObjectInstance(thisObject, "RegExp.prototype.flags");
 
 
@@ -606,7 +605,7 @@ internal sealed class RegExpPrototype : Prototype
         return result;
         return result;
     }
     }
 
 
-    private JsValue ToRegExpString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToRegExpString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var r = AssertThisIsObjectInstance(thisObject, "RegExp.prototype.toString");
         var r = AssertThisIsObjectInstance(thisObject, "RegExp.prototype.toString");
 
 
@@ -616,7 +615,7 @@ internal sealed class RegExpPrototype : Prototype
         return "/" + pattern + "/" + flags;
         return "/" + pattern + "/" + flags;
     }
     }
 
 
-    private JsValue Test(JsValue thisObject, JsValue[] arguments)
+    private JsValue Test(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var r = AssertThisIsObjectInstance(thisObject, "RegExp.prototype.test");
         var r = AssertThisIsObjectInstance(thisObject, "RegExp.prototype.test");
         var s = TypeConverter.ToString(arguments.At(0));
         var s = TypeConverter.ToString(arguments.At(0));
@@ -653,7 +652,7 @@ internal sealed class RegExpPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-regexp.prototype-@@search
     /// https://tc39.es/ecma262/#sec-regexp.prototype-@@search
     /// </summary>
     /// </summary>
-    private JsValue Search(JsValue thisObject, JsValue[] arguments)
+    private JsValue Search(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var rx = AssertThisIsObjectInstance(thisObject, "RegExp.prototype.search");
         var rx = AssertThisIsObjectInstance(thisObject, "RegExp.prototype.search");
 
 
@@ -682,7 +681,7 @@ internal sealed class RegExpPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-regexp.prototype-@@match
     /// https://tc39.es/ecma262/#sec-regexp.prototype-@@match
     /// </summary>
     /// </summary>
-    private JsValue Match(JsValue thisObject, JsValue[] arguments)
+    private JsValue Match(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var rx = AssertThisIsObjectInstance(thisObject, "RegExp.prototype.match");
         var rx = AssertThisIsObjectInstance(thisObject, "RegExp.prototype.match");
 
 
@@ -774,7 +773,7 @@ internal sealed class RegExpPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-regexp-prototype-matchall
     /// https://tc39.es/ecma262/#sec-regexp-prototype-matchall
     /// </summary>
     /// </summary>
-    private JsValue MatchAll(JsValue thisObject, JsValue[] arguments)
+    private JsValue MatchAll(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var r = AssertThisIsObjectInstance(thisObject, "RegExp.prototype.matchAll");
         var r = AssertThisIsObjectInstance(thisObject, "RegExp.prototype.matchAll");
 
 
@@ -782,11 +781,10 @@ internal sealed class RegExpPrototype : Prototype
         var c = SpeciesConstructor(r, _realm.Intrinsics.RegExp);
         var c = SpeciesConstructor(r, _realm.Intrinsics.RegExp);
 
 
         var flags = TypeConverter.ToJsString(r.Get(PropertyFlags));
         var flags = TypeConverter.ToJsString(r.Get(PropertyFlags));
-        var matcher = Construct(c, new JsValue[]
-        {
+        var matcher = Construct(c, [
             r,
             r,
             flags
             flags
-        });
+        ]);
 
 
         var lastIndex = TypeConverter.ToLength(r.Get(JsRegExp.PropertyLastIndex));
         var lastIndex = TypeConverter.ToLength(r.Get(JsRegExp.PropertyLastIndex));
         matcher.Set(JsRegExp.PropertyLastIndex, lastIndex, true);
         matcher.Set(JsRegExp.PropertyLastIndex, lastIndex, true);
@@ -825,7 +823,7 @@ internal sealed class RegExpPrototype : Prototype
 
 
         if ((ri is null || !ri.HasDefaultRegExpExec) && r.Get(PropertyExec) is ICallable callable)
         if ((ri is null || !ri.HasDefaultRegExpExec) && r.Get(PropertyExec) is ICallable callable)
         {
         {
-            var result = callable.Call(r, new JsValue[] { s });
+            var result = callable.Call(r, s);
             if (!result.IsNull() && !result.IsObject())
             if (!result.IsNull() && !result.IsObject())
             {
             {
                 ExceptionHelper.ThrowTypeError(r.Engine.Realm);
                 ExceptionHelper.ThrowTypeError(r.Engine.Realm);
@@ -970,7 +968,7 @@ internal sealed class RegExpPrototype : Prototype
             {
             {
                 if (capture?.Success == true)
                 if (capture?.Success == true)
                 {
                 {
-                    indices!.Add(new[] { JsNumber.Create(capture.Index), JsNumber.Create(capture.Index + capture.Length) });
+                    indices!.Add([JsNumber.Create(capture.Index), JsNumber.Create(capture.Index + capture.Length)]);
                 }
                 }
                 else
                 else
                 {
                 {
@@ -983,7 +981,7 @@ internal sealed class RegExpPrototype : Prototype
             {
             {
                 groups ??= OrdinaryObjectCreate(engine, null);
                 groups ??= OrdinaryObjectCreate(engine, null);
                 groups.CreateDataPropertyOrThrow(groupName, capturedValue);
                 groups.CreateDataPropertyOrThrow(groupName, capturedValue);
-                groupNames ??= new List<string>();
+                groupNames ??= [];
                 groupNames.Add(groupName!);
                 groupNames.Add(groupName!);
             }
             }
 
 
@@ -1072,7 +1070,7 @@ internal sealed class RegExpPrototype : Prototype
         return groupNameFromNumber;
         return groupNameFromNumber;
     }
     }
 
 
-    private JsValue Exec(JsValue thisObject, JsValue[] arguments)
+    private JsValue Exec(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var r = thisObject as JsRegExp;
         var r = thisObject as JsRegExp;
         if (r is null)
         if (r is null)

+ 2 - 2
Jint/Native/Set/SetConstructor.cs

@@ -42,7 +42,7 @@ public sealed class SetConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-set-iterable
     /// https://tc39.es/ecma262/#sec-set-iterable
     /// </summary>
     /// </summary>
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         var set = ConstructSet(newTarget);
         var set = ConstructSet(newTarget);
 
 
@@ -96,7 +96,7 @@ public sealed class SetConstructor : Constructor
         return set;
         return set;
     }
     }
 
 
-    private static JsValue Species(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Species(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return thisObject;
         return thisObject;
     }
     }

+ 15 - 15
Jint/Native/Set/SetPrototype.cs

@@ -57,13 +57,13 @@ internal sealed class SetPrototype : Prototype
         SetSymbols(symbols);
         SetSymbols(symbols);
     }
     }
 
 
-    private JsNumber Size(JsValue thisObject, JsValue[] arguments)
+    private JsNumber Size(JsValue thisObject, JsCallArguments arguments)
     {
     {
         AssertSetInstance(thisObject);
         AssertSetInstance(thisObject);
         return JsNumber.Create(0);
         return JsNumber.Create(0);
     }
     }
 
 
-    private JsValue Add(JsValue thisObject, JsValue[] arguments)
+    private JsValue Add(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var set = AssertSetInstance(thisObject);
         var set = AssertSetInstance(thisObject);
         var value = arguments.At(0);
         var value = arguments.At(0);
@@ -75,14 +75,14 @@ internal sealed class SetPrototype : Prototype
         return thisObject;
         return thisObject;
     }
     }
 
 
-    private JsValue Clear(JsValue thisObject, JsValue[] arguments)
+    private JsValue Clear(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var set = AssertSetInstance(thisObject);
         var set = AssertSetInstance(thisObject);
         set.Clear();
         set.Clear();
         return Undefined;
         return Undefined;
     }
     }
 
 
-    private JsBoolean Delete(JsValue thisObject, JsValue[] arguments)
+    private JsBoolean Delete(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var set = AssertSetInstance(thisObject);
         var set = AssertSetInstance(thisObject);
         return set.Delete(arguments.At(0))
         return set.Delete(arguments.At(0))
@@ -90,7 +90,7 @@ internal sealed class SetPrototype : Prototype
             : JsBoolean.False;
             : JsBoolean.False;
     }
     }
 
 
-    private JsSet Difference(JsValue thisObject, JsValue[] arguments)
+    private JsSet Difference(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var set = AssertSetInstance(thisObject);
         var set = AssertSetInstance(thisObject);
         var other = arguments.At(0);
         var other = arguments.At(0);
@@ -150,7 +150,7 @@ internal sealed class SetPrototype : Prototype
         return resultSetData;
         return resultSetData;
     }
     }
 
 
-    private JsBoolean IsDisjointFrom(JsValue thisObject, JsValue[] arguments)
+    private JsBoolean IsDisjointFrom(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var set = AssertSetInstance(thisObject);
         var set = AssertSetInstance(thisObject);
         var other = arguments.At(0);
         var other = arguments.At(0);
@@ -205,7 +205,7 @@ internal sealed class SetPrototype : Prototype
     }
     }
 
 
 
 
-    private JsSet Intersection(JsValue thisObject, JsValue[] arguments)
+    private JsSet Intersection(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var set = AssertSetInstance(thisObject);
         var set = AssertSetInstance(thisObject);
         var other = arguments.At(0);
         var other = arguments.At(0);
@@ -274,7 +274,7 @@ internal sealed class SetPrototype : Prototype
         return resultSetData;
         return resultSetData;
     }
     }
 
 
-    private JsSet SymmetricDifference(JsValue thisObject, JsValue[] arguments)
+    private JsSet SymmetricDifference(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var set = AssertSetInstance(thisObject);
         var set = AssertSetInstance(thisObject);
         var other = arguments.At(0);
         var other = arguments.At(0);
@@ -323,7 +323,7 @@ internal sealed class SetPrototype : Prototype
         return resultSetData;
         return resultSetData;
     }
     }
 
 
-    private JsBoolean IsSubsetOf(JsValue thisObject, JsValue[] arguments)
+    private JsBoolean IsSubsetOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var set = AssertSetInstance(thisObject);
         var set = AssertSetInstance(thisObject);
         var other = arguments.At(0);
         var other = arguments.At(0);
@@ -368,7 +368,7 @@ internal sealed class SetPrototype : Prototype
         return JsBoolean.True;
         return JsBoolean.True;
     }
     }
 
 
-    private JsBoolean IsSupersetOf(JsValue thisObject, JsValue[] arguments)
+    private JsBoolean IsSupersetOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var set = AssertSetInstance(thisObject);
         var set = AssertSetInstance(thisObject);
         var other = arguments.At(0);
         var other = arguments.At(0);
@@ -408,7 +408,7 @@ internal sealed class SetPrototype : Prototype
     }
     }
 
 
 
 
-    private JsBoolean Has(JsValue thisObject, JsValue[] arguments)
+    private JsBoolean Has(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var set = AssertSetInstance(thisObject);
         var set = AssertSetInstance(thisObject);
         return set.Has(arguments.At(0))
         return set.Has(arguments.At(0))
@@ -416,13 +416,13 @@ internal sealed class SetPrototype : Prototype
             : JsBoolean.False;
             : JsBoolean.False;
     }
     }
 
 
-    private ObjectInstance Entries(JsValue thisObject, JsValue[] arguments)
+    private ObjectInstance Entries(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var set = AssertSetInstance(thisObject);
         var set = AssertSetInstance(thisObject);
         return set.Entries();
         return set.Entries();
     }
     }
 
 
-    private JsValue ForEach(JsValue thisObject, JsValue[] arguments)
+    private JsValue ForEach(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var callbackfn = arguments.At(0);
         var callbackfn = arguments.At(0);
         var thisArg = arguments.At(1);
         var thisArg = arguments.At(1);
@@ -435,7 +435,7 @@ internal sealed class SetPrototype : Prototype
         return Undefined;
         return Undefined;
     }
     }
 
 
-    private JsSet Union(JsValue thisObject, JsValue[] arguments)
+    private JsSet Union(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var set = AssertSetInstance(thisObject);
         var set = AssertSetInstance(thisObject);
         var other = arguments.At(0);
         var other = arguments.At(0);
@@ -493,7 +493,7 @@ internal sealed class SetPrototype : Prototype
         return new SetRecord(Set: obj, Size: intSize, Has: (ICallable) has, Keys: (ICallable) keys);
         return new SetRecord(Set: obj, Size: intSize, Has: (ICallable) has, Keys: (ICallable) keys);
     }
     }
 
 
-    private ObjectInstance Values(JsValue thisObject, JsValue[] arguments)
+    private ObjectInstance Values(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var set = AssertSetInstance(thisObject);
         var set = AssertSetInstance(thisObject);
         return set.Values();
         return set.Values();

+ 2 - 2
Jint/Native/ShadowRealm/ShadowRealm.cs

@@ -311,7 +311,7 @@ public sealed class ShadowRealm : ObjectInstance
             SetFunctionLength(JsNumber.PositiveOne);
             SetFunctionLength(JsNumber.PositiveOne);
         }
         }
 
 
-        protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+        protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
         {
         {
             var exports = (ModuleNamespace) arguments.At(0);
             var exports = (ModuleNamespace) arguments.At(0);
             var f = this;
             var f = this;
@@ -360,7 +360,7 @@ public sealed class ShadowRealm : ObjectInstance
         /// <summary>
         /// <summary>
         /// https://tc39.es/proposal-shadowrealm/#sec-wrapped-function-exotic-objects-call-thisargument-argumentslist
         /// https://tc39.es/proposal-shadowrealm/#sec-wrapped-function-exotic-objects-call-thisargument-argumentslist
         /// </summary>
         /// </summary>
-        protected internal override JsValue Call(JsValue thisArgument, JsValue[] arguments)
+        protected internal override JsValue Call(JsValue thisArgument, JsCallArguments arguments)
         {
         {
             var target = _wrappedTargetFunction;
             var target = _wrappedTargetFunction;
             var targetRealm = GetFunctionRealm(target);
             var targetRealm = GetFunctionRealm(target);

+ 1 - 1
Jint/Native/ShadowRealm/ShadowRealmConstructor.cs

@@ -64,7 +64,7 @@ public sealed class ShadowRealmConstructor : Constructor
     }
     }
 
 
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         if (newTarget.IsUndefined())
         if (newTarget.IsUndefined())
         {
         {

+ 2 - 2
Jint/Native/ShadowRealm/ShadowRealmPrototype.cs

@@ -43,7 +43,7 @@ internal sealed class ShadowRealmPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/proposal-shadowrealm/#sec-shadowrealm.prototype.evaluate
     /// https://tc39.es/proposal-shadowrealm/#sec-shadowrealm.prototype.evaluate
     /// </summary>
     /// </summary>
-    private JsValue Evaluate(JsValue thisObject, JsValue[] arguments)
+    private JsValue Evaluate(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var shadowRealm = ValidateShadowRealmObject(thisObject);
         var shadowRealm = ValidateShadowRealmObject(thisObject);
         var sourceText = arguments.At(0);
         var sourceText = arguments.At(0);
@@ -66,7 +66,7 @@ internal sealed class ShadowRealmPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/proposal-shadowrealm/#sec-shadowrealm.prototype.importvalue
     /// https://tc39.es/proposal-shadowrealm/#sec-shadowrealm.prototype.importvalue
     /// </summary>
     /// </summary>
-    private JsValue ImportValue(JsValue thisObject, JsValue[] arguments)
+    private JsValue ImportValue(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var specifier = arguments.At(0);
         var specifier = arguments.At(0);
         var exportName = arguments.At(1);
         var exportName = arguments.At(1);

+ 4 - 4
Jint/Native/SharedArrayBuffer/SharedArrayBufferConstructor.cs

@@ -49,7 +49,7 @@ internal sealed class SharedArrayBufferConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-arraybuffer.isview
     /// https://tc39.es/ecma262/#sec-arraybuffer.isview
     /// </summary>
     /// </summary>
-    private static JsValue IsView(JsValue thisObject, JsValue[] arguments)
+    private static JsValue IsView(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var arg = arguments.At(0);
         var arg = arguments.At(0);
         return arg is JsDataView or JsTypedArray;
         return arg is JsDataView or JsTypedArray;
@@ -58,18 +58,18 @@ internal sealed class SharedArrayBufferConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-get-arraybuffer-@@species
     /// https://tc39.es/ecma262/#sec-get-arraybuffer-@@species
     /// </summary>
     /// </summary>
-    private static JsValue Species(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Species(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return thisObject;
         return thisObject;
     }
     }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         ExceptionHelper.ThrowTypeError(_realm, "Constructor SharedArrayBuffer requires 'new'");
         ExceptionHelper.ThrowTypeError(_realm, "Constructor SharedArrayBuffer requires 'new'");
         return Undefined;
         return Undefined;
     }
     }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         if (newTarget.IsUndefined())
         if (newTarget.IsUndefined())
         {
         {

+ 6 - 6
Jint/Native/SharedArrayBuffer/SharedArrayBufferPrototype.cs

@@ -44,7 +44,7 @@ internal sealed class SharedArrayBufferPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-get-sharedarraybuffer.prototype.bytelength
     /// https://tc39.es/ecma262/#sec-get-sharedarraybuffer.prototype.bytelength
     /// </summary>
     /// </summary>
-    private JsNumber ByteLength(JsValue thisObj, JsValue[] arguments)
+    private JsNumber ByteLength(JsValue thisObj, JsCallArguments arguments)
     {
     {
         var o = thisObj as JsSharedArrayBuffer;
         var o = thisObj as JsSharedArrayBuffer;
         if (o is null || !o.IsSharedArrayBuffer)
         if (o is null || !o.IsSharedArrayBuffer)
@@ -58,7 +58,7 @@ internal sealed class SharedArrayBufferPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-sharedarraybuffer.prototype.slice
     /// https://tc39.es/ecma262/#sec-sharedarraybuffer.prototype.slice
     /// </summary>
     /// </summary>
-    private JsSharedArrayBuffer Slice(JsValue thisObj, JsValue[] arguments)
+    private JsSharedArrayBuffer Slice(JsValue thisObj, JsCallArguments arguments)
     {
     {
         var o = thisObj as JsSharedArrayBuffer;
         var o = thisObj as JsSharedArrayBuffer;
         if (o is null || !o.IsSharedArrayBuffer)
         if (o is null || !o.IsSharedArrayBuffer)
@@ -99,7 +99,7 @@ internal sealed class SharedArrayBufferPrototype : Prototype
 
 
         var newLen = System.Math.Max(final - first, 0);
         var newLen = System.Math.Max(final - first, 0);
         var ctor = SpeciesConstructor(o, _realm.Intrinsics.SharedArrayBuffer);
         var ctor = SpeciesConstructor(o, _realm.Intrinsics.SharedArrayBuffer);
-        var bufferInstance = Construct(ctor, new JsValue[] { JsNumber.Create(newLen) }) as JsSharedArrayBuffer;
+        var bufferInstance = Construct(ctor, [JsNumber.Create(newLen)]) as JsSharedArrayBuffer;
 
 
         if (bufferInstance is null)
         if (bufferInstance is null)
         {
         {
@@ -142,7 +142,7 @@ internal sealed class SharedArrayBufferPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-get-sharedarraybuffer.prototype.growable
     /// https://tc39.es/ecma262/#sec-get-sharedarraybuffer.prototype.growable
     /// </summary>
     /// </summary>
-    private JsValue Growable(JsValue thisObject, JsValue[] arguments)
+    private JsValue Growable(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject as JsSharedArrayBuffer;
         var o = thisObject as JsSharedArrayBuffer;
         if (o is null || !o.IsSharedArrayBuffer)
         if (o is null || !o.IsSharedArrayBuffer)
@@ -156,7 +156,7 @@ internal sealed class SharedArrayBufferPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-sharedarraybuffer.prototype.grow
     /// https://tc39.es/ecma262/#sec-sharedarraybuffer.prototype.grow
     /// </summary>
     /// </summary>
-    private JsValue Grow(JsValue thisObject, JsValue[] arguments)
+    private JsValue Grow(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject as JsSharedArrayBuffer;
         var o = thisObject as JsSharedArrayBuffer;
         if (o is null || !o.IsSharedArrayBuffer)
         if (o is null || !o.IsSharedArrayBuffer)
@@ -177,7 +177,7 @@ internal sealed class SharedArrayBufferPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-get-sharedarraybuffer.prototype.maxbytelength
     /// https://tc39.es/ecma262/#sec-get-sharedarraybuffer.prototype.maxbytelength
     /// </summary>
     /// </summary>
-    private JsValue MaxByteLength(JsValue thisObject, JsValue[] arguments)
+    private JsValue MaxByteLength(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject as JsSharedArrayBuffer;
         var o = thisObject as JsSharedArrayBuffer;
         if (o is null || !o.IsSharedArrayBuffer)
         if (o is null || !o.IsSharedArrayBuffer)

+ 5 - 5
Jint/Native/String/StringConstructor.cs

@@ -48,7 +48,7 @@ internal sealed class StringConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string.fromcharcode
     /// https://tc39.es/ecma262/#sec-string.fromcharcode
     /// </summary>
     /// </summary>
-    private static JsValue FromCharCode(JsValue? thisObj, JsValue[] arguments)
+    private static JsValue FromCharCode(JsValue? thisObj, JsCallArguments arguments)
     {
     {
         var length = arguments.Length;
         var length = arguments.Length;
 
 
@@ -79,7 +79,7 @@ internal sealed class StringConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string.fromcodepoint
     /// https://tc39.es/ecma262/#sec-string.fromcodepoint
     /// </summary>
     /// </summary>
-    private JsValue FromCodePoint(JsValue thisObject, JsValue[] arguments)
+    private JsValue FromCodePoint(JsValue thisObject, JsCallArguments arguments)
     {
     {
         JsNumber codePoint;
         JsNumber codePoint;
         using var result = new ValueStringBuilder(stackalloc char[128]);
         using var result = new ValueStringBuilder(stackalloc char[128]);
@@ -131,7 +131,7 @@ internal sealed class StringConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string.raw
     /// https://tc39.es/ecma262/#sec-string.raw
     /// </summary>
     /// </summary>
-    private JsValue Raw(JsValue thisObject, JsValue[] arguments)
+    private JsValue Raw(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var cooked = TypeConverter.ToObject(_realm, arguments.At(0));
         var cooked = TypeConverter.ToObject(_realm, arguments.At(0));
         var raw = cooked.Get(JintTaggedTemplateExpression.PropertyRaw);
         var raw = cooked.Get(JintTaggedTemplateExpression.PropertyRaw);
@@ -160,7 +160,7 @@ internal sealed class StringConstructor : Constructor
         return result.ToString();
         return result.ToString();
     }
     }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (arguments.Length == 0)
         if (arguments.Length == 0)
         {
         {
@@ -178,7 +178,7 @@ internal sealed class StringConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string-constructor-string-value
     /// https://tc39.es/ecma262/#sec-string-constructor-string-value
     /// </summary>
     /// </summary>
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         JsString s;
         JsString s;
         if (arguments.Length == 0)
         if (arguments.Length == 0)

+ 44 - 44
Jint/Native/String/StringPrototype.cs

@@ -98,14 +98,14 @@ internal sealed class StringPrototype : StringInstance
 
 
     internal override bool HasOriginalIterator => ReferenceEquals(Get(GlobalSymbolRegistry.Iterator), _originalIteratorFunction);
     internal override bool HasOriginalIterator => ReferenceEquals(Get(GlobalSymbolRegistry.Iterator), _originalIteratorFunction);
 
 
-    private ObjectInstance Iterator(JsValue thisObject, JsValue[] arguments)
+    private ObjectInstance Iterator(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
         var str = TypeConverter.ToString(thisObject);
         var str = TypeConverter.ToString(thisObject);
         return _realm.Intrinsics.StringIteratorPrototype.Construct(str);
         return _realm.Intrinsics.StringIteratorPrototype.Construct(str);
     }
     }
 
 
-    private JsValue ToStringString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToStringString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (thisObject.IsString())
         if (thisObject.IsString())
         {
         {
@@ -193,7 +193,7 @@ internal sealed class StringPrototype : StringInstance
     /// https://tc39.es/ecma262/#sec-string.prototype.trim
     /// https://tc39.es/ecma262/#sec-string.prototype.trim
     /// </summary>
     /// </summary>
     [MethodImpl(MethodImplOptions.AggressiveInlining)]
     [MethodImpl(MethodImplOptions.AggressiveInlining)]
-    private JsValue Trim(JsValue thisObject, JsValue[] arguments)
+    private JsValue Trim(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         var s = TypeConverter.ToJsString(thisObject);
         var s = TypeConverter.ToJsString(thisObject);
@@ -207,7 +207,7 @@ internal sealed class StringPrototype : StringInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string.prototype.trimstart
     /// https://tc39.es/ecma262/#sec-string.prototype.trimstart
     /// </summary>
     /// </summary>
-    private JsValue TrimStart(JsValue thisObject, JsValue[] arguments)
+    private JsValue TrimStart(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         var s = TypeConverter.ToJsString(thisObject);
         var s = TypeConverter.ToJsString(thisObject);
@@ -221,7 +221,7 @@ internal sealed class StringPrototype : StringInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string.prototype.trimend
     /// https://tc39.es/ecma262/#sec-string.prototype.trimend
     /// </summary>
     /// </summary>
-    private JsValue TrimEnd(JsValue thisObject, JsValue[] arguments)
+    private JsValue TrimEnd(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         var s = TypeConverter.ToJsString(thisObject);
         var s = TypeConverter.ToJsString(thisObject);
@@ -232,7 +232,7 @@ internal sealed class StringPrototype : StringInstance
         return TrimEndEx(s.ToString());
         return TrimEndEx(s.ToString());
     }
     }
 
 
-    private JsValue ToLocaleUpperCase(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToLocaleUpperCase(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
         var s = TypeConverter.ToString(thisObject);
         var s = TypeConverter.ToString(thisObject);
@@ -264,21 +264,21 @@ internal sealed class StringPrototype : StringInstance
         return new JsString(s.ToUpper(culture));
         return new JsString(s.ToUpper(culture));
     }
     }
 
 
-    private JsValue ToUpperCase(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToUpperCase(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
         var s = TypeConverter.ToString(thisObject);
         var s = TypeConverter.ToString(thisObject);
         return new JsString(s.ToUpperInvariant());
         return new JsString(s.ToUpperInvariant());
     }
     }
 
 
-    private JsValue ToLocaleLowerCase(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToLocaleLowerCase(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
         var s = TypeConverter.ToString(thisObject);
         var s = TypeConverter.ToString(thisObject);
         return new JsString(s.ToLower(CultureInfo.InvariantCulture));
         return new JsString(s.ToLower(CultureInfo.InvariantCulture));
     }
     }
 
 
-    private JsValue ToLowerCase(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToLowerCase(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
         var s = TypeConverter.ToString(thisObject);
         var s = TypeConverter.ToString(thisObject);
@@ -306,7 +306,7 @@ internal sealed class StringPrototype : StringInstance
         return intVal;
         return intVal;
     }
     }
 
 
-    private JsValue Substring(JsValue thisObject, JsValue[] arguments)
+    private JsValue Substring(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
 
 
@@ -348,7 +348,7 @@ internal sealed class StringPrototype : StringInstance
         return new JsString(s.Substring(from, length));
         return new JsString(s.Substring(from, length));
     }
     }
 
 
-    private static JsValue Substr(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Substr(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var s = TypeConverter.ToString(thisObject);
         var s = TypeConverter.ToString(thisObject);
         var start = TypeConverter.ToInteger(arguments.At(0));
         var start = TypeConverter.ToInteger(arguments.At(0));
@@ -375,7 +375,7 @@ internal sealed class StringPrototype : StringInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string.prototype.split
     /// https://tc39.es/ecma262/#sec-string.prototype.split
     /// </summary>
     /// </summary>
-    private JsValue Split(JsValue thisObject, JsValue[] arguments)
+    private JsValue Split(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
 
 
@@ -393,7 +393,7 @@ internal sealed class StringPrototype : StringInstance
             var splitter = GetMethod(_realm, oi, GlobalSymbolRegistry.Split);
             var splitter = GetMethod(_realm, oi, GlobalSymbolRegistry.Split);
             if (splitter != null)
             if (splitter != null)
             {
             {
-                return splitter.Call(separator, new[] { thisObject, limit });
+                return splitter.Call(separator, thisObject, limit);
             }
             }
         }
         }
 
 
@@ -468,7 +468,7 @@ internal sealed class StringPrototype : StringInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/proposal-relative-indexing-method/#sec-string-prototype-additions
     /// https://tc39.es/proposal-relative-indexing-method/#sec-string-prototype-additions
     /// </summary>
     /// </summary>
-    private JsValue At(JsValue thisObject, JsValue[] arguments)
+    private JsValue At(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
         var start = arguments.At(0);
         var start = arguments.At(0);
@@ -496,7 +496,7 @@ internal sealed class StringPrototype : StringInstance
         return o[k];
         return o[k];
     }
     }
 
 
-    private JsValue Slice(JsValue thisObject, JsValue[] arguments)
+    private JsValue Slice(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
 
 
@@ -537,7 +537,7 @@ internal sealed class StringPrototype : StringInstance
         return s.Substring(from, span);
         return s.Substring(from, span);
     }
     }
 
 
-    private JsValue Search(JsValue thisObject, JsValue[] arguments)
+    private JsValue Search(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         var regex = arguments.At(0);
         var regex = arguments.At(0);
@@ -547,19 +547,19 @@ internal sealed class StringPrototype : StringInstance
             var searcher = GetMethod(_realm, oi, GlobalSymbolRegistry.Search);
             var searcher = GetMethod(_realm, oi, GlobalSymbolRegistry.Search);
             if (searcher != null)
             if (searcher != null)
             {
             {
-                return searcher.Call(regex, new[] { thisObject });
+                return searcher.Call(regex, thisObject);
             }
             }
         }
         }
 
 
         var rx = (JsRegExp) _realm.Intrinsics.RegExp.Construct(new[] {regex});
         var rx = (JsRegExp) _realm.Intrinsics.RegExp.Construct(new[] {regex});
         var s = TypeConverter.ToJsString(thisObject);
         var s = TypeConverter.ToJsString(thisObject);
-        return _engine.Invoke(rx, GlobalSymbolRegistry.Search, new JsValue[] { s });
+        return _engine.Invoke(rx, GlobalSymbolRegistry.Search, [s]);
     }
     }
 
 
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string.prototype.replace
     /// https://tc39.es/ecma262/#sec-string.prototype.replace
     /// </summary>
     /// </summary>
-    private JsValue Replace(JsValue thisObject, JsValue[] arguments)
+    private JsValue Replace(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
 
 
@@ -611,7 +611,7 @@ internal sealed class StringPrototype : StringInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string.prototype.replaceall
     /// https://tc39.es/ecma262/#sec-string.prototype.replaceall
     /// </summary>
     /// </summary>
-    private JsValue ReplaceAll(JsValue thisObject, JsValue[] arguments)
+    private JsValue ReplaceAll(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
 
 
@@ -706,7 +706,7 @@ internal sealed class StringPrototype : StringInstance
         return result.ToString();
         return result.ToString();
     }
     }
 
 
-    private JsValue Match(JsValue thisObject, JsValue[] arguments)
+    private JsValue Match(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
 
 
@@ -716,17 +716,17 @@ internal sealed class StringPrototype : StringInstance
             var matcher = GetMethod(_realm, oi, GlobalSymbolRegistry.Match);
             var matcher = GetMethod(_realm, oi, GlobalSymbolRegistry.Match);
             if (matcher != null)
             if (matcher != null)
             {
             {
-                return matcher.Call(regex, new[] { thisObject });
+                return matcher.Call(regex, thisObject);
             }
             }
         }
         }
 
 
         var rx = (JsRegExp) _realm.Intrinsics.RegExp.Construct(new[] {regex});
         var rx = (JsRegExp) _realm.Intrinsics.RegExp.Construct(new[] {regex});
 
 
         var s = TypeConverter.ToJsString(thisObject);
         var s = TypeConverter.ToJsString(thisObject);
-        return _engine.Invoke(rx, GlobalSymbolRegistry.Match, new JsValue[] { s });
+        return _engine.Invoke(rx, GlobalSymbolRegistry.Match, [s]);
     }
     }
 
 
-    private JsValue MatchAll(JsValue thisObject, JsValue[] arguments)
+    private JsValue MatchAll(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
 
 
@@ -745,17 +745,17 @@ internal sealed class StringPrototype : StringInstance
             var matcher = GetMethod(_realm, (ObjectInstance) regex, GlobalSymbolRegistry.MatchAll);
             var matcher = GetMethod(_realm, (ObjectInstance) regex, GlobalSymbolRegistry.MatchAll);
             if (matcher != null)
             if (matcher != null)
             {
             {
-                return matcher.Call(regex, new[] { thisObject });
+                return matcher.Call(regex, thisObject);
             }
             }
         }
         }
 
 
         var s = TypeConverter.ToJsString(thisObject);
         var s = TypeConverter.ToJsString(thisObject);
         var rx = (JsRegExp) _realm.Intrinsics.RegExp.Construct(new[] { regex, "g" });
         var rx = (JsRegExp) _realm.Intrinsics.RegExp.Construct(new[] { regex, "g" });
 
 
-        return _engine.Invoke(rx, GlobalSymbolRegistry.MatchAll, new JsValue[] { s });
+        return _engine.Invoke(rx, GlobalSymbolRegistry.MatchAll, [s]);
     }
     }
 
 
-    private JsValue LocaleCompare(JsValue thisObject, JsValue[] arguments)
+    private JsValue LocaleCompare(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
 
 
@@ -775,7 +775,7 @@ internal sealed class StringPrototype : StringInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string.prototype.lastindexof
     /// https://tc39.es/ecma262/#sec-string.prototype.lastindexof
     /// </summary>
     /// </summary>
-    private JsValue LastIndexOf(JsValue thisObject, JsValue[] arguments)
+    private JsValue LastIndexOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
 
 
@@ -831,7 +831,7 @@ internal sealed class StringPrototype : StringInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string.prototype.indexof
     /// https://tc39.es/ecma262/#sec-string.prototype.indexof
     /// </summary>
     /// </summary>
-    private JsValue IndexOf(JsValue thisObject, JsValue[] arguments)
+    private JsValue IndexOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
 
 
@@ -856,7 +856,7 @@ internal sealed class StringPrototype : StringInstance
         return s.IndexOf(searchStr, (int) pos);
         return s.IndexOf(searchStr, (int) pos);
     }
     }
 
 
-    private JsValue Concat(JsValue thisObject, JsValue[] arguments)
+    private JsValue Concat(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
 
 
@@ -877,7 +877,7 @@ internal sealed class StringPrototype : StringInstance
         return jsString;
         return jsString;
     }
     }
 
 
-    private JsValue CharCodeAt(JsValue thisObject, JsValue[] arguments)
+    private JsValue CharCodeAt(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
 
 
@@ -894,7 +894,7 @@ internal sealed class StringPrototype : StringInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string.prototype.codepointat
     /// https://tc39.es/ecma262/#sec-string.prototype.codepointat
     /// </summary>
     /// </summary>
-    private JsValue CodePointAt(JsValue thisObject, JsValue[] arguments)
+    private JsValue CodePointAt(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
 
 
@@ -939,7 +939,7 @@ internal sealed class StringPrototype : StringInstance
         return new CodePointResult(char.ConvertToUtf32(first, second), 2, false);
         return new CodePointResult(char.ConvertToUtf32(first, second), 2, false);
     }
     }
 
 
-    private JsValue CharAt(JsValue thisObject, JsValue[] arguments)
+    private JsValue CharAt(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         var s = TypeConverter.ToJsString(thisObject);
         var s = TypeConverter.ToJsString(thisObject);
@@ -952,7 +952,7 @@ internal sealed class StringPrototype : StringInstance
         return JsString.Create(s[(int) position]);
         return JsString.Create(s[(int) position]);
     }
     }
 
 
-    private JsValue ValueOf(JsValue thisObject, JsValue[] arguments)
+    private JsValue ValueOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (thisObject is StringInstance si)
         if (thisObject is StringInstance si)
         {
         {
@@ -971,7 +971,7 @@ internal sealed class StringPrototype : StringInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string.prototype.padstart
     /// https://tc39.es/ecma262/#sec-string.prototype.padstart
     /// </summary>
     /// </summary>
-    private JsValue PadStart(JsValue thisObject, JsValue[] arguments)
+    private JsValue PadStart(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return StringPad(thisObject, arguments, true);
         return StringPad(thisObject, arguments, true);
     }
     }
@@ -979,7 +979,7 @@ internal sealed class StringPrototype : StringInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string.prototype.padend
     /// https://tc39.es/ecma262/#sec-string.prototype.padend
     /// </summary>
     /// </summary>
-    private JsValue PadEnd(JsValue thisObject, JsValue[] arguments)
+    private JsValue PadEnd(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return StringPad(thisObject, arguments, false);
         return StringPad(thisObject, arguments, false);
     }
     }
@@ -987,7 +987,7 @@ internal sealed class StringPrototype : StringInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-stringpad
     /// https://tc39.es/ecma262/#sec-stringpad
     /// </summary>
     /// </summary>
-    private JsValue StringPad(JsValue thisObject, JsValue[] arguments, bool padStart)
+    private JsValue StringPad(JsValue thisObject, JsCallArguments arguments, bool padStart)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         var s = TypeConverter.ToJsString(thisObject);
         var s = TypeConverter.ToJsString(thisObject);
@@ -1018,7 +1018,7 @@ internal sealed class StringPrototype : StringInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string.prototype.startswith
     /// https://tc39.es/ecma262/#sec-string.prototype.startswith
     /// </summary>
     /// </summary>
-    private JsValue StartsWith(JsValue thisObject, JsValue[] arguments)
+    private JsValue StartsWith(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
 
 
@@ -1050,7 +1050,7 @@ internal sealed class StringPrototype : StringInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string.prototype.endswith
     /// https://tc39.es/ecma262/#sec-string.prototype.endswith
     /// </summary>
     /// </summary>
-    private JsValue EndsWith(JsValue thisObject, JsValue[] arguments)
+    private JsValue EndsWith(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
 
 
@@ -1081,7 +1081,7 @@ internal sealed class StringPrototype : StringInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string.prototype.includes
     /// https://tc39.es/ecma262/#sec-string.prototype.includes
     /// </summary>
     /// </summary>
-    private JsValue Includes(JsValue thisObject, JsValue[] arguments)
+    private JsValue Includes(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
 
 
@@ -1113,7 +1113,7 @@ internal sealed class StringPrototype : StringInstance
         return s.IndexOf(searchStr, (int) pos) > -1;
         return s.IndexOf(searchStr, (int) pos) > -1;
     }
     }
 
 
-    private JsValue Normalize(JsValue thisObject, JsValue[] arguments)
+    private JsValue Normalize(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         var str = TypeConverter.ToString(thisObject);
         var str = TypeConverter.ToString(thisObject);
@@ -1154,7 +1154,7 @@ internal sealed class StringPrototype : StringInstance
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-string.prototype.repeat
     /// https://tc39.es/ecma262/#sec-string.prototype.repeat
     /// </summary>
     /// </summary>
-    private JsValue Repeat(JsValue thisObject, JsValue[] arguments)
+    private JsValue Repeat(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         TypeConverter.RequireObjectCoercible(Engine, thisObject);
         var s = TypeConverter.ToString(thisObject);
         var s = TypeConverter.ToString(thisObject);
@@ -1186,7 +1186,7 @@ internal sealed class StringPrototype : StringInstance
         return sb.ToString();
         return sb.ToString();
     }
     }
 
 
-    private JsValue IsWellFormed(JsValue thisObject, JsValue[] arguments)
+    private JsValue IsWellFormed(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
         var s = TypeConverter.ToString(thisObject);
         var s = TypeConverter.ToString(thisObject);
@@ -1194,7 +1194,7 @@ internal sealed class StringPrototype : StringInstance
         return IsStringWellFormedUnicode(s);
         return IsStringWellFormedUnicode(s);
     }
     }
 
 
-    private JsValue ToWellFormed(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToWellFormed(JsValue thisObject, JsCallArguments arguments)
     {
     {
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
         TypeConverter.RequireObjectCoercible(_engine, thisObject);
         var s = TypeConverter.ToString(thisObject);
         var s = TypeConverter.ToString(thisObject);

+ 4 - 4
Jint/Native/Symbol/SymbolConstructor.cs

@@ -61,7 +61,7 @@ internal sealed class SymbolConstructor : Constructor
     /// <summary>
     /// <summary>
     /// http://www.ecma-international.org/ecma-262/6.0/index.html#sec-symbol-description
     /// http://www.ecma-international.org/ecma-262/6.0/index.html#sec-symbol-description
     /// </summary>
     /// </summary>
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var description = arguments.At(0);
         var description = arguments.At(0);
         var descString = description.IsUndefined()
         var descString = description.IsUndefined()
@@ -75,7 +75,7 @@ internal sealed class SymbolConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-symbol.for
     /// https://tc39.es/ecma262/#sec-symbol.for
     /// </summary>
     /// </summary>
-    private JsValue For(JsValue thisObject, JsValue[] arguments)
+    private JsValue For(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var stringKey = TypeConverter.ToJsString(arguments.At(0));
         var stringKey = TypeConverter.ToJsString(arguments.At(0));
 
 
@@ -93,7 +93,7 @@ internal sealed class SymbolConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-symbol.keyfor
     /// https://tc39.es/ecma262/#sec-symbol.keyfor
     /// </summary>
     /// </summary>
-    private JsValue KeyFor(JsValue thisObject, JsValue[] arguments)
+    private JsValue KeyFor(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var symbol = arguments.At(0) as JsSymbol;
         var symbol = arguments.At(0) as JsSymbol;
         if (symbol is null)
         if (symbol is null)
@@ -109,7 +109,7 @@ internal sealed class SymbolConstructor : Constructor
         return Undefined;
         return Undefined;
     }
     }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         ExceptionHelper.ThrowTypeError(_realm, "Symbol is not a constructor");
         ExceptionHelper.ThrowTypeError(_realm, "Symbol is not a constructor");
         return null;
         return null;

+ 4 - 4
Jint/Native/Symbol/SymbolPrototype.cs

@@ -49,7 +49,7 @@ internal sealed class SymbolPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-symbol.prototype.description
     /// https://tc39.es/ecma262/#sec-symbol.prototype.description
     /// </summary>
     /// </summary>
-    private JsValue Description(JsValue thisObject, JsValue[] arguments)
+    private JsValue Description(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var sym = ThisSymbolValue(thisObject);
         var sym = ThisSymbolValue(thisObject);
         return sym._value;
         return sym._value;
@@ -58,7 +58,7 @@ internal sealed class SymbolPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-symbol.prototype.tostring
     /// https://tc39.es/ecma262/#sec-symbol.prototype.tostring
     /// </summary>
     /// </summary>
-    private JsValue ToSymbolString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToSymbolString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var sym = ThisSymbolValue(thisObject);
         var sym = ThisSymbolValue(thisObject);
         return new JsString(sym.ToString());
         return new JsString(sym.ToString());
@@ -67,7 +67,7 @@ internal sealed class SymbolPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-symbol.prototype.valueof
     /// https://tc39.es/ecma262/#sec-symbol.prototype.valueof
     /// </summary>
     /// </summary>
-    private JsValue ValueOf(JsValue thisObject, JsValue[] arguments)
+    private JsValue ValueOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return ThisSymbolValue(thisObject);
         return ThisSymbolValue(thisObject);
     }
     }
@@ -75,7 +75,7 @@ internal sealed class SymbolPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
     /// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
     /// </summary>
     /// </summary>
-    private JsValue ToPrimitive(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToPrimitive(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return ThisSymbolValue(thisObject);
         return ThisSymbolValue(thisObject);
     }
     }

+ 14 - 14
Jint/Native/TypedArray/IntrinsicTypedArrayConstructor.cs

@@ -48,7 +48,7 @@ internal sealed class IntrinsicTypedArrayConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.from
     /// https://tc39.es/ecma262/#sec-%typedarray%.from
     /// </summary>
     /// </summary>
-    private JsValue From(JsValue thisObject, JsValue[] arguments)
+    private JsValue From(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var c = thisObject;
         var c = thisObject;
         if (!c.IsConstructor)
         if (!c.IsConstructor)
@@ -74,12 +74,12 @@ internal sealed class IntrinsicTypedArrayConstructor : Constructor
         {
         {
             var values = TypedArrayConstructor.IterableToList(_realm, source, usingIterator);
             var values = TypedArrayConstructor.IterableToList(_realm, source, usingIterator);
             var iteratorLen = values.Count;
             var iteratorLen = values.Count;
-            var iteratorTarget = TypedArrayCreate(_realm, (IConstructor) c, new JsValue[] { iteratorLen });
+            var iteratorTarget = TypedArrayCreate(_realm, (IConstructor) c, [iteratorLen]);
             for (var k = 0; k < iteratorLen; ++k)
             for (var k = 0; k < iteratorLen; ++k)
             {
             {
                 var kValue = values[k];
                 var kValue = values[k];
                 var mappedValue = mapping
                 var mappedValue = mapping
-                    ? ((ICallable) mapFunction).Call(thisArg, new[] { kValue, k })
+                    ? ((ICallable) mapFunction).Call(thisArg, kValue, k)
                     : kValue;
                     : kValue;
                 iteratorTarget[k] = mappedValue;
                 iteratorTarget[k] = mappedValue;
             }
             }
@@ -124,21 +124,21 @@ internal sealed class IntrinsicTypedArrayConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.of
     /// https://tc39.es/ecma262/#sec-%typedarray%.of
     /// </summary>
     /// </summary>
-    private JsValue Of(JsValue thisObject, JsValue[] items)
+    private JsValue Of(JsValue thisObject, JsCallArguments arguments)
     {
     {
-        var len = items.Length;
+        var len = arguments.Length;
 
 
         if (!thisObject.IsConstructor)
         if (!thisObject.IsConstructor)
         {
         {
             ExceptionHelper.ThrowTypeError(_realm);
             ExceptionHelper.ThrowTypeError(_realm);
         }
         }
 
 
-        var newObj = TypedArrayCreate(_realm, (IConstructor) thisObject, new JsValue[] { len });
+        var newObj = TypedArrayCreate(_realm, (IConstructor) thisObject, [len]);
 
 
         var k = 0;
         var k = 0;
         while (k < len)
         while (k < len)
         {
         {
-            var kValue = items[k];
+            var kValue = arguments[k];
             newObj[k] = kValue;
             newObj[k] = kValue;
             k++;
             k++;
         }
         }
@@ -149,7 +149,7 @@ internal sealed class IntrinsicTypedArrayConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#typedarray-species-create
     /// https://tc39.es/ecma262/#typedarray-species-create
     /// </summary>
     /// </summary>
-    internal JsTypedArray TypedArraySpeciesCreate(JsTypedArray exemplar, JsValue[] argumentList)
+    internal JsTypedArray TypedArraySpeciesCreate(JsTypedArray exemplar, JsCallArguments argumentList)
     {
     {
         var defaultConstructor = exemplar._arrayElementType.GetConstructor(_realm.Intrinsics)!;
         var defaultConstructor = exemplar._arrayElementType.GetConstructor(_realm.Intrinsics)!;
         var constructor = SpeciesConstructor(exemplar, defaultConstructor);
         var constructor = SpeciesConstructor(exemplar, defaultConstructor);
@@ -165,12 +165,12 @@ internal sealed class IntrinsicTypedArrayConstructor : Constructor
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#typedarray-create
     /// https://tc39.es/ecma262/#typedarray-create
     /// </summary>
     /// </summary>
-    internal static JsTypedArray TypedArrayCreate(Realm realm, IConstructor constructor, JsValue[] argumentList)
+    internal static JsTypedArray TypedArrayCreate(Realm realm, IConstructor constructor, JsCallArguments arguments)
     {
     {
-        var newTypedArray = Construct(constructor, argumentList);
+        var newTypedArray = Construct(constructor, arguments);
         var taRecord = newTypedArray.ValidateTypedArray(realm);
         var taRecord = newTypedArray.ValidateTypedArray(realm);
 
 
-        if (argumentList.Length == 1 && argumentList[0] is JsNumber number)
+        if (arguments.Length == 1 && arguments[0] is JsNumber number)
         {
         {
             if (taRecord.IsTypedArrayOutOfBounds)
             if (taRecord.IsTypedArrayOutOfBounds)
             {
             {
@@ -185,18 +185,18 @@ internal sealed class IntrinsicTypedArrayConstructor : Constructor
         return taRecord.Object;
         return taRecord.Object;
     }
     }
 
 
-    private static JsValue Species(JsValue thisObject, JsValue[] arguments)
+    private static JsValue Species(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return thisObject;
         return thisObject;
     }
     }
 
 
-    protected internal override JsValue Call(JsValue thisObject, JsValue[] arguments)
+    protected internal override JsValue Call(JsValue thisObject, JsCallArguments arguments)
     {
     {
         ExceptionHelper.ThrowTypeError(_realm, "Abstract class TypedArray not directly callable");
         ExceptionHelper.ThrowTypeError(_realm, "Abstract class TypedArray not directly callable");
         return Undefined;
         return Undefined;
     }
     }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         ExceptionHelper.ThrowTypeError(_realm, "Abstract class TypedArray not directly constructable");
         ExceptionHelper.ThrowTypeError(_realm, "Abstract class TypedArray not directly constructable");
         return null;
         return null;

+ 43 - 43
Jint/Native/TypedArray/IntrinsicTypedArrayPrototype.cs

@@ -90,7 +90,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-get-%typedarray%.prototype.buffer
     /// https://tc39.es/ecma262/#sec-get-%typedarray%.prototype.buffer
     /// </summary>
     /// </summary>
-    private JsValue Buffer(JsValue thisObject, JsValue[] arguments)
+    private JsValue Buffer(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject as JsTypedArray;
         var o = thisObject as JsTypedArray;
         if (o is null)
         if (o is null)
@@ -104,7 +104,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-get-%typedarray%.prototype.bytelength
     /// https://tc39.es/ecma262/#sec-get-%typedarray%.prototype.bytelength
     /// </summary>
     /// </summary>
-    private JsValue ByteLength(JsValue thisObject, JsValue[] arguments)
+    private JsValue ByteLength(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject as JsTypedArray;
         var o = thisObject as JsTypedArray;
         if (o is null)
         if (o is null)
@@ -119,7 +119,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-get-%typedarray%.prototype.byteoffset
     /// https://tc39.es/ecma262/#sec-get-%typedarray%.prototype.byteoffset
     /// </summary>
     /// </summary>
-    private JsValue ByteOffset(JsValue thisObject, JsValue[] arguments)
+    private JsValue ByteOffset(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject as JsTypedArray;
         var o = thisObject as JsTypedArray;
         if (o is null)
         if (o is null)
@@ -139,7 +139,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-get-%typedarray%.prototype.length
     /// https://tc39.es/ecma262/#sec-get-%typedarray%.prototype.length
     /// </summary>
     /// </summary>
-    private JsValue GetLength(JsValue thisObject, JsValue[] arguments)
+    private JsValue GetLength(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject as JsTypedArray;
         var o = thisObject as JsTypedArray;
         if (o is null)
         if (o is null)
@@ -272,7 +272,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin
     /// </summary>
     /// </summary>
-    private JsValue CopyWithin(JsValue thisObject, JsValue[] arguments)
+    private JsValue CopyWithin(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var o = taRecord.Object;
         var o = taRecord.Object;
@@ -388,7 +388,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries
     /// </summary>
     /// </summary>
-    private JsValue Entries(JsValue thisObject, JsValue[] arguments)
+    private JsValue Entries(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var o = taRecord.Object;
         var o = taRecord.Object;
@@ -398,7 +398,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.every
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.every
     /// </summary>
     /// </summary>
-    private JsValue Every(JsValue thisObject, JsValue[] arguments)
+    private JsValue Every(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var o = taRecord.Object;
         var o = taRecord.Object;
@@ -432,7 +432,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill
     /// </summary>
     /// </summary>
-    private JsValue Fill(JsValue thisObject, JsValue[] arguments)
+    private JsValue Fill(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var o = taRecord.Object;
         var o = taRecord.Object;
@@ -504,7 +504,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter
     /// </summary>
     /// </summary>
-    private JsValue Filter(JsValue thisObject, JsValue[] arguments)
+    private JsValue Filter(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var callbackfn = GetCallable(arguments.At(0));
         var callbackfn = GetCallable(arguments.At(0));
         var thisArg = arguments.At(1);
         var thisArg = arguments.At(1);
@@ -533,7 +533,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
 
 
         _engine._jsValueArrayPool.ReturnArray(args);
         _engine._jsValueArrayPool.ReturnArray(args);
 
 
-        var a = _realm.Intrinsics.TypedArray.TypedArraySpeciesCreate(o, new JsValue[] { captured });
+        var a = _realm.Intrinsics.TypedArray.TypedArraySpeciesCreate(o, [captured]);
         for (var n = 0; n < captured; ++n)
         for (var n = 0; n < captured; ++n)
         {
         {
             a[n] = kept[n];
             a[n] = kept[n];
@@ -545,7 +545,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.find
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.find
     /// </summary>
     /// </summary>
-    private JsValue Find(JsValue thisObject, JsValue[] arguments)
+    private JsValue Find(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return DoFind(thisObject, arguments).Value;
         return DoFind(thisObject, arguments).Value;
     }
     }
@@ -553,22 +553,22 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex
     /// </summary>
     /// </summary>
-    private JsValue FindIndex(JsValue thisObject, JsValue[] arguments)
+    private JsValue FindIndex(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return DoFind(thisObject, arguments).Key;
         return DoFind(thisObject, arguments).Key;
     }
     }
 
 
-    private JsValue FindLast(JsValue thisObject, JsValue[] arguments)
+    private JsValue FindLast(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return DoFind(thisObject, arguments, fromEnd: true).Value;
         return DoFind(thisObject, arguments, fromEnd: true).Value;
     }
     }
 
 
-    private JsValue FindLastIndex(JsValue thisObject, JsValue[] arguments)
+    private JsValue FindLastIndex(JsValue thisObject, JsCallArguments arguments)
     {
     {
         return DoFind(thisObject, arguments, fromEnd: true).Key;
         return DoFind(thisObject, arguments, fromEnd: true).Key;
     }
     }
 
 
-    private KeyValuePair<JsValue, JsValue> DoFind(JsValue thisObject, JsValue[] arguments, bool fromEnd = false)
+    private KeyValuePair<JsValue, JsValue> DoFind(JsValue thisObject, JsCallArguments arguments, bool fromEnd = false)
     {
     {
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var o = taRecord.Object;
         var o = taRecord.Object;
@@ -619,7 +619,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach
     /// </summary>
     /// </summary>
-    private JsValue ForEach(JsValue thisObject, JsValue[] arguments)
+    private JsValue ForEach(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var callbackfn = GetCallable(arguments.At(0));
         var callbackfn = GetCallable(arguments.At(0));
         var thisArg = arguments.At(1);
         var thisArg = arguments.At(1);
@@ -646,7 +646,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes
     /// </summary>
     /// </summary>
-    private JsValue Includes(JsValue thisObject, JsValue[] arguments)
+    private JsValue Includes(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var o = taRecord.Object;
         var o = taRecord.Object;
@@ -701,7 +701,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof
     /// </summary>
     /// </summary>
-    private JsValue IndexOf(JsValue thisObject, JsValue[] arguments)
+    private JsValue IndexOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var searchElement = arguments.At(0);
         var searchElement = arguments.At(0);
         var fromIndex = arguments.At(1);
         var fromIndex = arguments.At(1);
@@ -758,7 +758,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.join
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.join
     /// </summary>
     /// </summary>
-    private JsValue Join(JsValue thisObject, JsValue[] arguments)
+    private JsValue Join(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var separator = arguments.At(0);
         var separator = arguments.At(0);
 
 
@@ -800,7 +800,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys
     /// </summary>
     /// </summary>
-    private JsValue Keys(JsValue thisObject, JsValue[] arguments)
+    private JsValue Keys(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var o = taRecord.Object;
         var o = taRecord.Object;
@@ -810,7 +810,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof
     /// </summary>
     /// </summary>
-    private JsValue LastIndexOf(JsValue thisObject, JsValue[] arguments)
+    private JsValue LastIndexOf(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var searchElement = arguments.At(0);
         var searchElement = arguments.At(0);
 
 
@@ -860,7 +860,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.map
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.map
     /// </summary>
     /// </summary>
-    private ObjectInstance Map(JsValue thisObject, JsValue[] arguments)
+    private ObjectInstance Map(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var o = taRecord.Object;
         var o = taRecord.Object;
@@ -869,7 +869,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
         var thisArg = arguments.At(1);
         var thisArg = arguments.At(1);
         var callable = GetCallable(arguments.At(0));
         var callable = GetCallable(arguments.At(0));
 
 
-        var a = _realm.Intrinsics.TypedArray.TypedArraySpeciesCreate(o, new JsValue[] { len });
+        var a = _realm.Intrinsics.TypedArray.TypedArraySpeciesCreate(o, [len]);
         var args = _engine._jsValueArrayPool.RentArray(3);
         var args = _engine._jsValueArrayPool.RentArray(3);
         args[2] = o;
         args[2] = o;
         for (var k = 0; k < len; k++)
         for (var k = 0; k < len; k++)
@@ -887,7 +887,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce
     /// </summary>
     /// </summary>
-    private JsValue Reduce(JsValue thisObject, JsValue[] arguments)
+    private JsValue Reduce(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var callbackfn = GetCallable(arguments.At(0));
         var callbackfn = GetCallable(arguments.At(0));
         var initialValue = arguments.At(1);
         var initialValue = arguments.At(1);
@@ -933,7 +933,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright
     /// </summary>
     /// </summary>
-    private JsValue ReduceRight(JsValue thisObject, JsValue[] arguments)
+    private JsValue ReduceRight(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var callbackfn = GetCallable(arguments.At(0));
         var callbackfn = GetCallable(arguments.At(0));
         var initialValue = arguments.At(1);
         var initialValue = arguments.At(1);
@@ -976,7 +976,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse
     /// </summary>
     /// </summary>
-    private ObjectInstance Reverse(JsValue thisObject, JsValue[] arguments)
+    private ObjectInstance Reverse(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var o = taRecord.Object;
         var o = taRecord.Object;
@@ -1003,7 +1003,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.set
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.set
     /// </summary>
     /// </summary>
-    private JsValue Set(JsValue thisObject, JsValue[] arguments)
+    private JsValue Set(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var target = thisObject as JsTypedArray;
         var target = thisObject as JsTypedArray;
         if (target is null)
         if (target is null)
@@ -1157,7 +1157,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/proposal-relative-indexing-method/#sec-%typedarray.prototype%-additions
     /// https://tc39.es/proposal-relative-indexing-method/#sec-%typedarray.prototype%-additions
     /// </summary>
     /// </summary>
-    private JsValue At(JsValue thisObject, JsValue[] arguments)
+    private JsValue At(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var start = arguments.At(0);
         var start = arguments.At(0);
 
 
@@ -1188,7 +1188,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice
     /// </summary>
     /// </summary>
-    private JsValue Slice(JsValue thisObject, JsValue[] arguments)
+    private JsValue Slice(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var start = arguments.At(0);
         var start = arguments.At(0);
         var end = arguments.At(1);
         var end = arguments.At(1);
@@ -1231,7 +1231,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
         }
         }
 
 
         var countBytes = System.Math.Max(endIndex - startIndex, 0);
         var countBytes = System.Math.Max(endIndex - startIndex, 0);
-        var a = _realm.Intrinsics.TypedArray.TypedArraySpeciesCreate(o, new JsValue[] { countBytes });
+        var a = _realm.Intrinsics.TypedArray.TypedArraySpeciesCreate(o, [countBytes]);
 
 
         if (countBytes > 0)
         if (countBytes > 0)
         {
         {
@@ -1281,7 +1281,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.some
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.some
     /// </summary>
     /// </summary>
-    private JsValue Some(JsValue thisObject, JsValue[] arguments)
+    private JsValue Some(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var o = taRecord.Object;
         var o = taRecord.Object;
@@ -1309,7 +1309,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort
     /// </summary>
     /// </summary>
-    private JsValue Sort(JsValue thisObject, JsValue[] arguments)
+    private JsValue Sort(JsValue thisObject, JsCallArguments arguments)
     {
     {
         /*
         /*
          * %TypedArray%.prototype.sort is a distinct function that, except as described below,
          * %TypedArray%.prototype.sort is a distinct function that, except as described below,
@@ -1344,7 +1344,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray
     /// </summary>
     /// </summary>
-    private JsValue Subarray(JsValue thisObject, JsValue[] arguments)
+    private JsValue Subarray(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = thisObject as JsTypedArray;
         var o = thisObject as JsTypedArray;
         if (o is null)
         if (o is null)
@@ -1384,7 +1384,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
         var srcByteOffset = o._byteOffset;
         var srcByteOffset = o._byteOffset;
         var beginByteOffset = srcByteOffset + startIndex * elementSize;
         var beginByteOffset = srcByteOffset + startIndex * elementSize;
 
 
-        JsValue[] argumentsList;
+        JsCallArguments argumentsList;
         if (o._arrayLength == JsTypedArray.LengthAuto && end.IsUndefined())
         if (o._arrayLength == JsTypedArray.LengthAuto && end.IsUndefined())
         {
         {
             argumentsList = [buffer, beginByteOffset];
             argumentsList = [buffer, beginByteOffset];
@@ -1425,7 +1425,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring
     /// </summary>
     /// </summary>
-    private JsValue ToLocaleString(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToLocaleString(JsValue thisObject, JsCallArguments arguments)
     {
     {
         /*
         /*
          * %TypedArray%.prototype.toLocaleString is a distinct function that implements the same algorithm as Array.prototype.toLocaleString
          * %TypedArray%.prototype.toLocaleString is a distinct function that implements the same algorithm as Array.prototype.toLocaleString
@@ -1466,7 +1466,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.values
     /// https://tc39.es/ecma262/#sec-%typedarray%.prototype.values
     /// </summary>
     /// </summary>
-    private JsValue Values(JsValue thisObject, JsValue[] arguments)
+    private JsValue Values(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var o = taRecord.Object;
         var o = taRecord.Object;
@@ -1476,7 +1476,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
     /// <summary>
     /// <summary>
     /// https://tc39.es/ecma262/#sec-get-%typedarray%.prototype-@@tostringtag
     /// https://tc39.es/ecma262/#sec-get-%typedarray%.prototype-@@tostringtag
     /// </summary>
     /// </summary>
-    private static JsValue ToStringTag(JsValue thisObject, JsValue[] arguments)
+    private static JsValue ToStringTag(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (thisObject is not JsTypedArray o)
         if (thisObject is not JsTypedArray o)
         {
         {
@@ -1486,13 +1486,13 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
         return o._arrayElementType.GetTypedArrayName();
         return o._arrayElementType.GetTypedArrayName();
     }
     }
 
 
-    private JsValue ToReversed(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToReversed(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var o = taRecord.Object;
         var o = taRecord.Object;
         var len = taRecord.TypedArrayLength;
         var len = taRecord.TypedArrayLength;
 
 
-        var a = TypedArrayCreateSameType(o, new [] { JsNumber.Create(len) });
+        var a = TypedArrayCreateSameType(o, [JsNumber.Create(len)]);
         uint k = 0;
         uint k = 0;
         while (k < len)
         while (k < len)
         {
         {
@@ -1503,7 +1503,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
         return a;
         return a;
     }
     }
 
 
-    private JsValue ToSorted(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToSorted(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var o = taRecord.Object;
         var o = taRecord.Object;
@@ -1513,7 +1513,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
 
 
         var buffer = o._viewedArrayBuffer;
         var buffer = o._viewedArrayBuffer;
 
 
-        var a = TypedArrayCreateSameType(o, new [] { JsNumber.Create(len) });
+        var a = TypedArrayCreateSameType(o, [JsNumber.Create(len)]);
 
 
         var array = SortArray(buffer, compareFn, o);
         var array = SortArray(buffer, compareFn, o);
         for (var i = 0; (uint) i < (uint) array.Length; ++i)
         for (var i = 0; (uint) i < (uint) array.Length; ++i)
@@ -1524,7 +1524,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
         return a;
         return a;
     }
     }
 
 
-    private ObjectInstance With(JsValue thisObject, JsValue[] arguments)
+    private ObjectInstance With(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var taRecord = thisObject.ValidateTypedArray(_realm, ArrayBufferOrder.SeqCst);
         var o = taRecord.Object;
         var o = taRecord.Object;
@@ -1553,7 +1553,7 @@ internal sealed class IntrinsicTypedArrayPrototype : Prototype
             ExceptionHelper.ThrowRangeError(_realm, "Invalid start index");
             ExceptionHelper.ThrowRangeError(_realm, "Invalid start index");
         }
         }
 
 
-        var a = TypedArrayCreateSameType(o, new [] { JsNumber.Create(len) });
+        var a = TypedArrayCreateSameType(o, [JsNumber.Create(len)]);
 
 
         var k = 0;
         var k = 0;
         while (k < len)
         while (k < len)

+ 2 - 2
Jint/Native/TypedArray/TypedArrayConstructor.Uint8Array.cs

@@ -38,7 +38,7 @@ public sealed class Uint8ArrayConstructor : TypedArrayConstructor
         return array;
         return array;
     }
     }
 
 
-    private JsTypedArray FromBase64(JsValue thisObject, JsValue[] arguments)
+    private JsTypedArray FromBase64(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var s = arguments.At(0);
         var s = arguments.At(0);
 
 
@@ -293,7 +293,7 @@ public sealed class Uint8ArrayConstructor : TypedArrayConstructor
         into.AddRange(bytes);
         into.AddRange(bytes);
     }
     }
 
 
-    private JsTypedArray FromHex(JsValue thisObject, JsValue[] arguments)
+    private JsTypedArray FromHex(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var s = arguments.At(0);
         var s = arguments.At(0);
 
 

+ 1 - 1
Jint/Native/TypedArray/TypedArrayConstructor.cs

@@ -52,7 +52,7 @@ public abstract class TypedArrayConstructor : Constructor
         return o;
         return o;
     }
     }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         if (newTarget.IsUndefined())
         if (newTarget.IsUndefined())
         {
         {

+ 4 - 4
Jint/Native/TypedArray/Uint8ArrayPrototype.cs

@@ -38,7 +38,7 @@ internal sealed class Uint8ArrayPrototype : Prototype
         SetProperties(properties);
         SetProperties(properties);
     }
     }
 
 
-    private JsObject SetFromBase64(JsValue thisObject, JsValue[] arguments)
+    private JsObject SetFromBase64(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var into = ValidateUint8Array(thisObject);
         var into = ValidateUint8Array(thisObject);
         var s = arguments.At(0);
         var s = arguments.At(0);
@@ -87,7 +87,7 @@ internal sealed class Uint8ArrayPrototype : Prototype
         }
         }
     }
     }
 
 
-    private JsObject SetFromHex(JsValue thisObject, JsValue[] arguments)
+    private JsObject SetFromHex(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var into = ValidateUint8Array(thisObject);
         var into = ValidateUint8Array(thisObject);
         var s = arguments.At(0);
         var s = arguments.At(0);
@@ -118,7 +118,7 @@ internal sealed class Uint8ArrayPrototype : Prototype
         return resultObject;
         return resultObject;
     }
     }
 
 
-    private JsValue ToBase64(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToBase64(JsValue thisObject, JsCallArguments arguments)
     {
     {
        var o = ValidateUint8Array(thisObject);
        var o = ValidateUint8Array(thisObject);
 
 
@@ -149,7 +149,7 @@ internal sealed class Uint8ArrayPrototype : Prototype
         return outAscii;
         return outAscii;
     }
     }
 
 
-    private JsValue ToHex(JsValue thisObject, JsValue[] arguments)
+    private JsValue ToHex(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var o = ValidateUint8Array(thisObject);
         var o = ValidateUint8Array(thisObject);
         var toEncode = GetUint8ArrayBytes(o);
         var toEncode = GetUint8ArrayBytes(o);

+ 1 - 1
Jint/Native/WeakMap/WeakMapConstructor.cs

@@ -25,7 +25,7 @@ internal sealed class WeakMapConstructor : Constructor
 
 
     public WeakMapPrototype PrototypeObject { get; }
     public WeakMapPrototype PrototypeObject { get; }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         if (newTarget.IsUndefined())
         if (newTarget.IsUndefined())
         {
         {

+ 4 - 4
Jint/Native/WeakMap/WeakMapPrototype.cs

@@ -47,26 +47,26 @@ internal sealed class WeakMapPrototype : Prototype
         SetSymbols(symbols);
         SetSymbols(symbols);
     }
     }
 
 
-    private JsValue Get(JsValue thisObject, JsValue[] arguments)
+    private JsValue Get(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var map = AssertWeakMapInstance(thisObject);
         var map = AssertWeakMapInstance(thisObject);
         return map.WeakMapGet(arguments.At(0));
         return map.WeakMapGet(arguments.At(0));
     }
     }
 
 
-    private JsValue Delete(JsValue thisObject, JsValue[] arguments)
+    private JsValue Delete(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var map = AssertWeakMapInstance(thisObject);
         var map = AssertWeakMapInstance(thisObject);
         return arguments.Length > 0 && map.WeakMapDelete(arguments.At(0)) ? JsBoolean.True : JsBoolean.False;
         return arguments.Length > 0 && map.WeakMapDelete(arguments.At(0)) ? JsBoolean.True : JsBoolean.False;
     }
     }
 
 
-    private JsValue Set(JsValue thisObject, JsValue[] arguments)
+    private JsValue Set(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var map = AssertWeakMapInstance(thisObject);
         var map = AssertWeakMapInstance(thisObject);
         map.WeakMapSet(arguments.At(0), arguments.At(1));
         map.WeakMapSet(arguments.At(0), arguments.At(1));
         return thisObject;
         return thisObject;
     }
     }
 
 
-    private JsValue Has(JsValue thisObject, JsValue[] arguments)
+    private JsValue Has(JsValue thisObject, JsCallArguments arguments)
     {
     {
         var map = AssertWeakMapInstance(thisObject);
         var map = AssertWeakMapInstance(thisObject);
         return map.WeakMapHas(arguments.At(0)) ? JsBoolean.True : JsBoolean.False;
         return map.WeakMapHas(arguments.At(0)) ? JsBoolean.True : JsBoolean.False;

+ 1 - 1
Jint/Native/WeakRef/WeakRefConstructor.cs

@@ -27,7 +27,7 @@ internal sealed class WeakRefConstructor : Constructor
 
 
     private WeakRefPrototype PrototypeObject { get; }
     private WeakRefPrototype PrototypeObject { get; }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         if (newTarget.IsUndefined())
         if (newTarget.IsUndefined())
         {
         {

+ 1 - 1
Jint/Native/WeakRef/WeakRefPrototype.cs

@@ -41,7 +41,7 @@ internal sealed class WeakRefPrototype : Prototype
         SetSymbols(symbols);
         SetSymbols(symbols);
     }
     }
 
 
-    private JsValue Deref(JsValue thisObject, JsValue[] arguments)
+    private JsValue Deref(JsValue thisObject, JsCallArguments arguments)
     {
     {
         if (thisObject is JsWeakRef weakRef)
         if (thisObject is JsWeakRef weakRef)
         {
         {

+ 1 - 1
Jint/Native/WeakSet/WeakSetConstructor.cs

@@ -24,7 +24,7 @@ internal sealed class WeakSetConstructor : Constructor
 
 
     private WeakSetPrototype PrototypeObject { get; }
     private WeakSetPrototype PrototypeObject { get; }
 
 
-    public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
+    public override ObjectInstance Construct(JsCallArguments arguments, JsValue newTarget)
     {
     {
         if (newTarget.IsUndefined())
         if (newTarget.IsUndefined())
         {
         {

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.