JSObject.makeArray constructor

JSObject.makeArray(
  1. JSContext context,
  2. JSValuePointer arguments, {
  3. JSValuePointer? exception,
})

Creates a JavaScript Array object. The behavior of this function does not exactly match the behavior of the built-in Array constructor. Specifically, if one argument is supplied, this function returns an array with one element. arguments A JSValue array of data to populate the Array with. Pass NULL if argumentCount is 0. exception (JSValueRef*) A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.

Implementation

JSObject.makeArray(
  this.context,
  JSValuePointer arguments, {
  JSValuePointer? exception,
}) : this.pointer = JSObjectRef.jSObjectMakeArray(
          context.pointer,
          arguments.count,
          arguments.pointer,
          (exception ?? JSValuePointer(nullptr)).pointer);