javascriptcore.c.types

C types for javascriptcore6 library

Types 26

Enum values to specify a mode to check for syntax errors in [javascriptcore.context.Context.checkSyntax].

Script = 0mode to check syntax of a script
Module = 1mode to check syntax of a module

Enum values to specify the result of [javascriptcore.context.Context.checkSyntax].

Success = 0no errors
RecoverableError = 1recoverable syntax error
IrrecoverableError = 2irrecoverable syntax error
UnterminatedLiteralError = 3unterminated literal error
OutOfMemoryError = 4out of memory error
StackOverflowError = 5stack overflow error

Enum values for options types.

Boolean = 0A #gboolean option type.
Int = 1A #gint option type.
Uint = 2A #guint option type.
Size = 3A #gsize options type.
Double = 4A #gdouble options type.
String = 5A string option type.
RangeString = 6A range string option type.

Possible types of the elements contained in a typed array.

None = 0Not a typed array, or type unsupported.
Int8 = 1Array elements are 8-bit signed integers (int8_t).
Int16 = 2Array elements are 16-bit signed integers (int16_t).
Int32 = 3Array elements are 32-bit signed integers (int32_t).
Int64 = 4Array elements are 64-bit signed integers (int64_t).
Uint8 = 5Array elements are 8-bit unsigned integers (uint8_t).
Uint8Clamped = 6Array elements are 8-bit unsigned integers (uint8_t).
Uint16 = 7Array elements are 16-bit unsigned integers (uint16_t).
Uint32 = 8Array elements are 32-bit unsigned integers (uint32_t).
Uint64 = 9Array elements are 64-bit unsigned integers (uint64_t).
Float32 = 10Array elements are 32-bit floating point numbers (float).
Float64 = 11Array elements are 64-bit floating point numbers (double).

Flags used when defining properties with [javascriptcore.value.Value.objectDefinePropertyData] and [javascriptcore.value.Value.objectDefinePropertyAccessor].

Configurable = 1the type of the property descriptor may be changed and the property may be deleted from the corresponding object.
Enumerable = 2the property shows up during enumeration of the properties on the corresponding object.
Writable = 4the value associated with the property may be changed with an assignment operator. This doesn't have any effect when passed to [javascriptcore.value.Value.objectDefinePropertyAccessor].
structJSCClass

A JSSClass represents a custom JavaScript class registered by the user in a #JSCContext. It allows to create new JavaScripts objects whose instances are created by the user using this API. It's possible to add constructors, properties and methods for a JSSClass by providing #GCallback<!-- -->s to implement them.

Fields
GObjectClass parentClass

Virtual table for a JSCClass. This can be optionally used when registering a #JSCClass in a #JSCContext to provide a custom implementation for the class. All virtual functions are optional and can be set to null to fallback to the default implementation.

Fields
JSCClassGetPropertyFunction getPropertya #JSCClassGetPropertyFunction for getting a property.
JSCClassSetPropertyFunction setPropertya #JSCClassSetPropertyFunction for setting a property.
JSCClassHasPropertyFunction hasPropertya #JSCClassHasPropertyFunction for querying a property.
JSCClassDeletePropertyFunction deletePropertya #JSCClassDeletePropertyFunction for deleting a property.
JSCClassEnumeratePropertiesFunction enumeratePropertiesa #JSCClassEnumeratePropertiesFunction for enumerating properties.
void function() JscReserved0
void function() JscReserved1
void function() JscReserved2
void function() JscReserved3
void function() JscReserved4
void function() JscReserved5
void function() JscReserved6
void function() JscReserved7

JSCContext represents a JavaScript execution context, where all operations take place and where the values will be associated.

When a new context is created, a global object is allocated and the built-in JavaScript objects (Object, Function, String, Array) are populated. You can execute JavaScript in the context by using [javascriptcore.context.Context.evaluate] or [javascriptcore.context.Context.evaluateWithSourceUri]. It's also possible to register custom objects in the context with [javascriptcore.context.Context.registerClass].

Fields
GObjectClass parentClass
Fields
GObjectClass parentClass

JSCException represents a JavaScript exception.

structJSCValue

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

Fields
GObjectClass parentClass

JSCVirtualMachine represents a group of JSCContext<!-- -->s. It allows concurrent JavaScript execution by creating a different instance of JSCVirtualMachine in each thread.

To create a group of JSCContext<!-- -->s pass the same JSCVirtualMachine instance to every JSCContext constructor.

Fields
GObjectClass parentClass

JSCWeakValue represents a weak reference to a value in a #JSCContext. It can be used to keep a reference to a JavaScript value without protecting it from being garbage collected and without referencing the #JSCContext either.

Fields
GObjectClass parentClass
aliasJSCClassDeletePropertyFunction = gboolean function(JSCClass * jscClass, JSCContext * context, void * instance, const(char) * name)
aliasJSCClassEnumeratePropertiesFunction = char * * function(JSCClass * jscClass, JSCContext * context, void * instance)
aliasJSCClassGetPropertyFunction = JSCValue * function(JSCClass * jscClass, JSCContext * context, void * instance, const(char) * name)
aliasJSCClassHasPropertyFunction = gboolean function(JSCClass * jscClass, JSCContext * context, void * instance, const(char) * name)
aliasJSCClassSetPropertyFunction = gboolean function(JSCClass * jscClass, JSCContext * context, void * instance, const(char) * name, JSCValue * value)
aliasJSCExceptionHandler = void function(JSCContext * context, JSCException * exception, void * userData)
aliasJSCExecutor = void function(JSCValue * resolve, JSCValue * reject, void * userData)
aliasJSCOptionsFunc = gboolean function(const(char) * option, JSCOptionType type, const(char) * description, void * userData)