1.4 <JSCValue>

Class: <JSCValue>

It derives from <GObject>.

JSCValue represents a reference to a value in a <JSCContext>. The JSCValue protects the referenced value from being garbage collected.

Properties

Property: value:context self

The <JSCContext> in which the value was created.

Its value is a <JSCContext>, or #f.

It can only be set when the object is made, with #:context.

Procedures

Method: value:array-buffer-get-data self ⇒ %return
Method: array-buffer-get-data self ⇒ %return

Gets a pointer to memory that contains the array buffer data.

Obtains a pointer to the memory region that holds the contents of the ArrayBuffer; modifications done to the data will be visible to JavaScript code. If size is not #f, the size in bytes of the memory region will also be stored in the pointed location.

Note that the pointer returned by this function is not guaranteed to remain the same after calls to other JSC API functions. If you plan to access the data of the ArrayBuffer later, you can keep a reference to the self and obtain the data pointer at a later point. Keep in mind that if JavaScript code has a chance to run, for example due to main loop events that result in JSC being called, the contents of the memory region might be modified in the meantime. Consider taking a copy of the data and using the copy instead in asynchronous code.

self

Passed: a <JSCValue>.

A <JSCValue>

%return

Returned: a bytevector.

pointer to memory.

size

Not returned: it is the length of %return.

location where to store the size of the memory region.

Method: value:array-buffer-get-size self ⇒ %return
Method: array-buffer-get-size self ⇒ %return

Gets the size in bytes of the array buffer.

Obtains the size in bytes of the memory region that holds the contents of an ArrayBuffer.

self

Passed: a <JSCValue>.

A <JSCValue>

%return

Returned: an unsigned 64-bit integer.

size, in bytes.

Method: value:constructor-call self [parameters] ⇒ %return
Method: constructor-call self [parameters] ⇒ %return

Invoke new() with constructor referenced by self. If first-parameter-type is G_TYPE_NONE no parameters will be passed to the constructor.

self

Passed: a <JSCValue>.

a <JSCValue>

parameters

Passed, or left out: a list or vector, each a <JSCValue>, or #f.

%return

Returned: a <JSCValue>.

a <JSCValue> referencing the newly created object instance.

n-parameters

Not passed: guile-gi gives the length of parameters.

first-parameter-type

GType of first parameter, or G_TYPE_NONE

...

value of the first parameter, followed optionally by more type/value pairs, followed by G_TYPE_NONE

Method: value:function-call self [parameters] ⇒ %return
Method: function-call self [parameters] ⇒ %return

Call function referenced by self, passing the given parameters. If first-parameter-type is G_TYPE_NONE no parameters will be passed to the function.

This function always returns a <JSCValue>, in case of void functions a <JSCValue> referencing undefined() is returned

self

Passed: a <JSCValue>.

a <JSCValue>

parameters

Passed, or left out: a list or vector, each a <JSCValue>, or #f.

%return

Returned: a <JSCValue>.

a <JSCValue> with the return value of the function.

n-parameters

Not passed: guile-gi gives the length of parameters.

first-parameter-type

GType of first parameter, or G_TYPE_NONE

...

value of the first parameter, followed optionally by more type/value pairs, followed by G_TYPE_NONE

Method: value:get-context self ⇒ %return
Method: get-context self ⇒ %return

Get the <JSCContext> in which self was created.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a <JSCContext>.

the <JSCValue> context.

Method: value:is-array-buffer? self ⇒ %return
Method: is-array-buffer? self ⇒ %return

Check whether the self is an ArrayBuffer.

self

Passed: a <JSCValue>.

A <JSCValue>.

%return

Returned: a boolean.

whether the value is an ArrayBuffer

Method: value:is-array? self ⇒ %return
Method: is-array? self ⇒ %return

Get whether the value referenced by self is an array.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a boolean.

whether the value is an array.

Method: value:is-boolean? self ⇒ %return
Method: is-boolean? self ⇒ %return

Get whether the value referenced by self is a boolean.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a boolean.

whether the value is a boolean.

Method: value:is-constructor? self ⇒ %return
Method: is-constructor? self ⇒ %return

Get whether the value referenced by self is a constructor.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a boolean.

whether the value is a constructor.

Method: value:is-function? self ⇒ %return
Method: is-function? self ⇒ %return

Get whether the value referenced by self is a function

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a boolean.

whether the value is a function.

Method: value:is-null? self ⇒ %return
Method: is-null? self ⇒ %return

Get whether the value referenced by self is null().

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a boolean.

whether the value is null.

Method: value:is-number? self ⇒ %return
Method: is-number? self ⇒ %return

Get whether the value referenced by self is a number.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a boolean.

whether the value is a number.

Method: value:is-object? self ⇒ %return
Method: is-object? self ⇒ %return

Get whether the value referenced by self is an object.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a boolean.

whether the value is an object.

Method: value:is-string? self ⇒ %return
Method: is-string? self ⇒ %return

Get whether the value referenced by self is a string

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a boolean.

whether the value is a string

Method: value:is-typed-array? self ⇒ %return
Method: is-typed-array? self ⇒ %return

Determines whether a value is a typed array.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a boolean.

Whether self is a typed array.

Method: value:is-undefined? self ⇒ %return
Method: is-undefined? self ⇒ %return

Get whether the value referenced by self is undefined().

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a boolean.

whether the value is undefined.

Procedure: value:new-array-buffer context data size [destroy-notify] ⇒ %return

Creates a new ArrayBuffer from existing data in memory.

The data is not copied: while this allows sharing data with JavaScript efficiently, the caller must ensure that the memory region remains valid until the newly created object is released by JSC.

Optionally, a destroy-notify callback can be provided, which will be invoked with user-data as parameter when the ArrayBuffer object is released. This is intended to be used for freeing resources related to the memory region which contains the data:

!<-- language="C" -->
GMappedFile *f = g_mapped_file_new (file_path, TRUE, NULL);
JSCValue *value = jsc_value_new_array_buffer (context,
    g_mapped_file_get_contents (f), g_mapped_file_get_length (f),
    (GDestroyNotify) g_mapped_file_unref, f);

Note that the user-data can be the same value as data:

!<-- language="C" -->
void *bytes = g_malloc0 (100);
JSCValue *value = jsc_value_new_array_buffer (context, bytes, 100, g_free, bytes);
context

Passed: a <JSCContext>.

A <JSCContext>

data

Passed: a foreign pointer, or a bytevector, or #f.

Pointer to a region of memory.

size

Passed: an unsigned 64-bit integer.

Size in bytes of the memory region.

destroy-notify

Passed, or left out: a procedure, or #f.

destroy notifier for user-data.

See GDestroyNotify for how it is called.

%return

Returned: a <JSCValue>, or #f.

A <JSCValue>, or #f in case of exception.

user-data

Not passed: guile-gi supplies it.

user data.

Procedure: value:new-array-from-garray context [array] ⇒ %return

Create a new <JSCValue> referencing an array with the items from array. If array is #f or empty a new empty array will be created. Elements of array should be pointers to a <JSCValue>.

context

Passed: a <JSCContext>.

a <JSCContext>

array

Passed, or left out: a list or vector, each a <JSCValue>, or #f.

a <GPtrArray>

%return

Returned: a <JSCValue>.

a <JSCValue>.

Procedure: value:new-array-from-strv context strv ⇒ %return

Create a new <JSCValue> referencing an array of strings with the items from strv. If array is #f or empty a new empty array will be created.

context

Passed: a <JSCContext>.

a <JSCContext>

strv

Passed: a list or vector, each a string.

a #f-terminated array of strings

%return

Returned: a <JSCValue>.

a <JSCValue>.

Procedure: value:new-boolean context value ⇒ %return

Create a new <JSCValue> from value

context

Passed: a <JSCContext>.

a <JSCContext>

value

Passed: a boolean.

a gboolean

%return

Returned: a <JSCValue>.

a <JSCValue>.

Procedure: value:new-from-json context json ⇒ %return

Create a new <JSCValue> referencing a new value created by parsing json.

context

Passed: a <JSCContext>.

a <JSCContext>

json

Passed: a string.

the JSON string to be parsed

%return

Returned: a <JSCValue>.

a <JSCValue>.

Procedure: value:new-function context name callback return-type [parameter-types] ⇒ %return

Create a function in context. If name is #f an anonymous function will be created. When the function is called by JavaScript or value:function-call, callback is called receiving the function parameters and then user-data as last parameter. When the function is cleared in context, destroy-notify is called with user-data as parameter.

Note that the value returned by callback must be fully transferred. In case of boxed types, you could use G_TYPE_POINTER instead of the actual boxed GType to ensure that the instance owned by <JSCClass> is used. If you really want to return a new copy of the boxed type, use JSC_TYPE_VALUE and return a <JSCValue> created with value:new-object that receives the copy as instance parameter.

context

Passed: a <JSCContext>.

a #JSCContext:

name

Passed: a string, or #f.

the function name or #f

callback

Passed: a procedure.

a GCallback.

See GCallback for how it is called.

return-type

Passed: a class, or a GType number.

the GType of the function return value, or G_TYPE_NONE if the function is void.

parameter-types

Passed, or left out: a list or vector, each a class, or a GType number, or #f.

%return

Returned: a <JSCValue>.

a <JSCValue>.

n-parameters

Not passed: guile-gi gives the length of parameter-types.

user-data

Not passed: guile-gi supplies it.

user data to pass to callback.

destroy-notify

Not passed: guile-gi supplies it.

destroy notifier for user-data

See GDestroyNotify for how it is called.

n-params

the number of parameter types to follow or 0 if the function doesn’t receive parameters.

...

a list of GType<!– –>s, one for each parameter.

Procedure: value:new-function-variadic context name callback return-type ⇒ %return

Create a function in context. If name is #f an anonymous function will be created. When the function is called by JavaScript or value:function-call, callback is called receiving an <GPtrArray> of <JSCValue><!– –>s with the arguments and then user-data as last parameter. When the function is cleared in context, destroy-notify is called with user-data as parameter.

Note that the value returned by callback must be fully transferred. In case of boxed types, you could use G_TYPE_POINTER instead of the actual boxed GType to ensure that the instance owned by <JSCClass> is used. If you really want to return a new copy of the boxed type, use JSC_TYPE_VALUE and return a <JSCValue> created with value:new-object that receives the copy as instance parameter.

context

Passed: a <JSCContext>.

a <JSCContext>

name

Passed: a string, or #f.

the function name or #f

callback

Passed: a procedure.

a GCallback.

See GCallback for how it is called.

return-type

Passed: a class, or a GType number.

the GType of the function return value, or G_TYPE_NONE if the function is void.

%return

Returned: a <JSCValue>.

a <JSCValue>.

user-data

Not passed: guile-gi supplies it.

user data to pass to callback.

destroy-notify

Not passed: guile-gi supplies it.

destroy notifier for user-data

See GDestroyNotify for how it is called.

Procedure: value:new-null context ⇒ %return

Create a new <JSCValue> referencing null() in context.

context

Passed: a <JSCContext>.

a <JSCContext>

%return

Returned: a <JSCValue>.

a <JSCValue>.

Procedure: value:new-number context number ⇒ %return

Create a new <JSCValue> from number.

context

Passed: a <JSCContext>.

a <JSCContext>

number

Passed: a real number.

a number

%return

Returned: a <JSCValue>.

a <JSCValue>.

Procedure: value:new-object context [instance] [jsc-class] ⇒ %return

Create a new <JSCValue> from instance. If instance is #f a new empty object is created. When instance is provided, jsc-class must be provided too. jsc-class takes ownership of instance that will be freed by the GDestroyNotify passed to jsc_context_register_class().

context

Passed: a <JSCContext>.

a <JSCContext>

instance

Passed, or left out: a foreign pointer, or a bytevector, or #f.

an object instance or #f

jsc-class

Passed, or left out: a <JSCClass>, or #f.

the <JSCClass> of instance

%return

Returned: a <JSCValue>.

a <JSCValue>.

Procedure: value:new-promise context executor ⇒ %return

Creates a new Promise. executor will be invoked during promise initialization and it receives the resolve and reject objects than can be called to resolve or reject the promise. It is called like a JavaScript function, so exceptions raised during the executor invocation will not be propagated to the context, but handled by the promise causing a rejection.

context

Passed: a <JSCContext>.

a <JSCContext>

executor

Passed: a procedure.

an initialization callback

See JSCExecutor for how it is called.

%return

Returned: a <JSCValue>.

a deferred promise object

user-data

Not passed: guile-gi supplies it.

user data passed in executor

Procedure: value:new-string context [string] ⇒ %return

Create a new <JSCValue> from string. If you need to create a <JSCValue> from a string containing null characters, use value:new-string-from-bytes instead.

context

Passed: a <JSCContext>.

a <JSCContext>

string

Passed, or left out: a string, or #f.

a null-terminated string

%return

Returned: a <JSCValue>.

a <JSCValue>.

Procedure: value:new-string-from-bytes context [bytes] ⇒ %return

Create a new <JSCValue> from bytes.

context

Passed: a <JSCContext>.

a <JSCContext>

bytes

Passed, or left out: a <GBytes>, or #f.

a <GBytes>

%return

Returned: a <JSCValue>.

a <JSCValue>.

Procedure: value:new-typed-array context type length ⇒ %return

Create a new typed array containing a given amount of elements.

Create a <JSCValue> referencing a new typed array with space for length elements of a given type. As all typed arrays must have an associated ArrayBuffer, a new one of suitable size will be allocated to store the elements, which will be initialized to zero.

The type must not be none.

context

Passed: a <JSCContext>.

a <JSCContext>

type

Passed: a <%JSCTypedArrayType>, or one of its symbols.

the type of array elements

length

Passed: an unsigned 64-bit integer.

number of elements in the array

%return

Returned: a <JSCValue>.

a <JSCValue>

Method: value:new-typed-array-with-buffer self type offset length ⇒ %return
Method: new-typed-array-with-buffer self type offset length ⇒ %return

Create a new typed array value with elements from an array buffer.

Create a <JSCValue> referencing a new typed array value containing elements of the given type, where the elements are stored at the memory region represented by the self.

The type must not be none.

The offset and length parameters can be used to indicate which part of the array buffer can be accessed through the typed array. If both are omitted (passing zero as offset, and -1 as length), the whole self is exposed through the typed array. Omitting the length with a non-zero offset will expose the remainder of the self starting at the indicated offset.

self

Passed: a <JSCValue>.

a <JSCValue>.

type

Passed: a <%JSCTypedArrayType>, or one of its symbols.

type of array elements.

offset

Passed: an unsigned 64-bit integer.

offset, in bytes.

length

Passed: a 64-bit integer.

number of array elements, or -1.

%return

Returned: a <JSCValue>.

a <JSCValue>

Procedure: value:new-undefined context ⇒ %return

Create a new <JSCValue> referencing undefined() in context.

context

Passed: a <JSCContext>.

a <JSCContext>

%return

Returned: a <JSCValue>.

a <JSCValue>.

Method: value:object-define-property-accessor self property-name flags property-type [getter] [setter]
Method: object-define-property-accessor self property-name flags property-type [getter] [setter]

Define or modify a property with property-name in object referenced by self. When the property value is read or set, getter and setter callbacks will be called. When the property is cleared in the <JSCClass> context, destroy-notify is called with user-data as parameter. This is equivalent to JavaScript Object.defineProperty() when used with an accessor descriptor.

Note that the value returned by getter must be fully transferred. In case of boxed types, you could use G_TYPE_POINTER instead of the actual boxed GType to ensure that the instance owned by <JSCClass> is used. If you really want to return a new copy of the boxed type, use JSC_TYPE_VALUE and return a <JSCValue> created with value:new-object that receives the copy as instance parameter.

Note that getter and setter are called as functions and not methods, so they don’t receive an instance as first parameter. Use class:add-property if you want to add property accessor invoked as a method.

self

Passed: a <JSCValue>.

a <JSCValue>

property-name

Passed: a string.

the name of the property to define

flags

Passed: a <%JSCValuePropertyFlags>, or a list of its symbols, or one of them.

<%JSCValuePropertyFlags>

property-type

Passed: a class, or a GType number.

the GType of the property

getter

Passed, or left out: a procedure, or #f.

a GCallback to be called to get the property value

See GCallback for how it is called.

setter

Passed, or left out: a procedure, or #f.

a GCallback to be called to set the property value

See GCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

user data to pass to getter and setter

destroy-notify

Not passed: guile-gi supplies it.

destroy notifier for user-data

See GDestroyNotify for how it is called.

Method: value:object-define-property-data self property-name flags [property-value]
Method: object-define-property-data self property-name flags [property-value]

Define or modify a property with property-name in object referenced by self. This is equivalent to JavaScript Object.defineProperty() when used with a data descriptor.

self

Passed: a <JSCValue>.

a <JSCValue>

property-name

Passed: a string.

the name of the property to define

flags

Passed: a <%JSCValuePropertyFlags>, or a list of its symbols, or one of them.

<%JSCValuePropertyFlags>

property-value

Passed, or left out: a <JSCValue>, or #f.

the default property value

Method: value:object-delete-property? self name ⇒ %return
Method: object-delete-property? self name ⇒ %return

Try to delete property with name from self. This function will return #f if the property was defined without configurable flag.

self

Passed: a <JSCValue>.

a <JSCValue>

name

Passed: a string.

the property name

%return

Returned: a boolean.

#t if the property was deleted, or #f otherwise.

Method: value:object-enumerate-properties self ⇒ %return
Method: object-enumerate-properties self ⇒ %return

Get the list of property names of self. Only properties defined with enumerable flag will be collected.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a vector, each a string, or #f.

a #f-terminated array of strings containing the property names, or #f if self doesn’t have enumerable properties. Use strfreev to free.

Method: value:object-get-property self name ⇒ %return
Method: object-get-property self name ⇒ %return

Get property with name from self.

self

Passed: a <JSCValue>.

a <JSCValue>

name

Passed: a string.

the property name

%return

Returned: a <JSCValue>.

the property <JSCValue>.

Method: value:object-get-property-at-index self index ⇒ %return
Method: object-get-property-at-index self index ⇒ %return

Get property at index from self.

self

Passed: a <JSCValue>.

a <JSCValue>

index

Passed: an unsigned 32-bit integer.

the property index

%return

Returned: a <JSCValue>.

the property <JSCValue>.

Method: value:object-has-property? self name ⇒ %return
Method: object-has-property? self name ⇒ %return

Get whether self has property with name.

self

Passed: a <JSCValue>.

a <JSCValue>

name

Passed: a string.

the property name

%return

Returned: a boolean.

#t if self has a property with name, or #f otherwise

Method: value:object-invoke-method self name [parameters] ⇒ %return
Method: object-invoke-method self name [parameters] ⇒ %return

Invoke method with name on object referenced by self, passing the given parameters. If first-parameter-type is G_TYPE_NONE no parameters will be passed to the method. The object instance will be handled automatically even when the method is a custom one registered with class:add-method, so it should never be passed explicitly as parameter of this function.

This function always returns a <JSCValue>, in case of void methods a <JSCValue> referencing undefined() is returned.

self

Passed: a <JSCValue>.

a <JSCValue>

name

Passed: a string.

the method name

parameters

Passed, or left out: a list or vector, each a <JSCValue>, or #f.

%return

Returned: a <JSCValue>.

a <JSCValue> with the return value of the method.

n-parameters

Not passed: guile-gi gives the length of parameters.

first-parameter-type

GType of first parameter, or G_TYPE_NONE

...

value of the first parameter, followed optionally by more type/value pairs, followed by G_TYPE_NONE

Method: value:object-is-instance-of? self name ⇒ %return
Method: object-is-instance-of? self name ⇒ %return

Get whether the value referenced by self is an instance of class name.

self

Passed: a <JSCValue>.

a <JSCValue>

name

Passed: a string.

a class name

%return

Returned: a boolean.

whether the value is an object instance of class name.

Method: value:object-set-property self name property
Method: object-set-property self name property

Set property with name on self.

self

Passed: a <JSCValue>.

a <JSCValue>

name

Passed: a string.

the property name

property

Passed: a <JSCValue>.

the <JSCValue> to set

Method: value:object-set-property-at-index self index property
Method: object-set-property-at-index self index property

Set property at index on self.

self

Passed: a <JSCValue>.

a <JSCValue>

index

Passed: an unsigned 32-bit integer.

the property index

property

Passed: a <JSCValue>.

the <JSCValue> to set

Method: value:to-boolean? self ⇒ %return
Method: to-boolean? self ⇒ %return

Convert self to a boolean.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a boolean.

a gboolean result of the conversion.

Method: value:to-double self ⇒ %return
Method: to-double self ⇒ %return

Convert self to a double.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a real number.

a gdouble result of the conversion.

Method: value:to-int32 self ⇒ %return
Method: to-int32 self ⇒ %return

Convert self to a gint32.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a 32-bit integer.

a gint32 result of the conversion.

Method: value:to-json self indent ⇒ %return
Method: to-json self indent ⇒ %return

Create a JSON string of self serialization. If indent is 0, the resulting JSON will not contain newlines. The size of the indent is clamped to 10 spaces.

self

Passed: a <JSCValue>.

a <JSCValue>

indent

Passed: an unsigned 32-bit integer.

The number of spaces to indent when nesting.

%return

Returned: a string.

a null-terminated JSON string with serialization of self

Method: value:to-string self ⇒ %return
Method: to-string self ⇒ %return

Convert self to a string. Use value:to-string-as-bytes instead, if you need to handle strings containing null characters.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a string.

a null-terminated string result of the conversion.

Method: value:to-string-as-bytes self ⇒ %return
Method: to-string-as-bytes self ⇒ %return

Convert self to a string and return the results as <GBytes>. This is needed to handle strings with null characters.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a <GBytes>.

a <GBytes> with the result of the conversion.

Method: value:typed-array-get-buffer self ⇒ %return
Method: typed-array-get-buffer self ⇒ %return

Obtain the ArrayBuffer for the memory region of the typed array elements.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a <JSCValue>.

A <JSCValue>

Method: value:typed-array-get-data self ⇒ %return length
Method: typed-array-get-data self ⇒ %return length

Obtains a pointer to the memory region that holds the elements of the typed array; modifications done to them will be visible to JavaScript code. If length is not #f, the number of elements contained in the typed array are also stored in the pointed location.

The returned pointer needs to be casted to the appropriate type (see <%JSCTypedArrayType>), and has the offset over the underlying array buffer data applied—that is, points to the first element of the typed array:


if (jsc_value_typed_array_get_type(value) != JSC_TYPED_ARRAY_UINT32)
    g_error ("Only arrays of uint32_t are supported");

gsize count = 0;
uint32_t *elements = jsc_value_typed_array_get_contents (value, &count);
for (gsize i = 0; i < count; i++)
     g_print ("index %zu, value %" PRIu32 "\n", i, elements[i]);

Note that the pointer returned by this function is not guaranteed to remain the same after calls to other JSC API functions. See value:array-buffer-get-data for details.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a foreign pointer, or #f.

pointer to memory.

length

Returned: an unsigned 64-bit integer.

location to return the number of elements contained

Method: value:typed-array-get-length self ⇒ %return
Method: typed-array-get-length self ⇒ %return

Gets the number of elements in a typed array.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: an unsigned 64-bit integer.

number of elements.

Method: value:typed-array-get-offset self ⇒ %return
Method: typed-array-get-offset self ⇒ %return

Gets the offset over the underlying array buffer data.

self

Passed: a <JSCValue>.

A <JSCValue>

%return

Returned: an unsigned 64-bit integer.

offset, in bytes.

Method: value:typed-array-get-size self ⇒ %return
Method: typed-array-get-size self ⇒ %return

Gets the size of a typed array.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: an unsigned 64-bit integer.

size, in bytes.

Method: value:typed-array-get-type self ⇒ %return
Method: typed-array-get-type self ⇒ %return

Gets the type of elements contained in a typed array.

self

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a <%JSCTypedArrayType>.

type of the elements, or none if self is not a typed array.