JsArray.cs 823 B

123456789101112131415161718192021222324
  1. using Jint.Native.Array;
  2. namespace Jint.Native;
  3. public sealed class JsArray : ArrayInstance
  4. {
  5. /// <summary>
  6. /// Creates a new array instance with defaults.
  7. /// </summary>
  8. /// <param name="engine">The engine that this array is bound to.</param>
  9. /// <param name="capacity">The initial size of underlying data structure, if you know you're going to add N items, provide N.</param>
  10. /// <param name="length">Sets the length of the array.</param>
  11. public JsArray(Engine engine, uint capacity = 0, uint length = 0) : base(engine, capacity, length)
  12. {
  13. }
  14. /// <summary>
  15. /// Possibility to construct valid array fast.
  16. /// The array will be owned and modified by Jint afterwards.
  17. /// </summary>
  18. public JsArray(Engine engine, JsValue[] items) : base(engine, items)
  19. {
  20. }
  21. }