### Namespace

# JavaScriptCore – 6.0

The JavaScriptCore library

Version | 2.48.0
Authors | The WebKit GTK and WPE teams
License | BSD, LGPL-2.1
Website | https://webkit.org
Source |

#### Build

C headers | `jsc/jsc.h`
pkg-config files | `javascriptcoregtk-6.0`

#### Dependencies

GObject—2.0 | The base type system library
| Browse documentation

#### Additional documentation

- Classes Hierarchy

#### Classes

Class | 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. unstable since: 6.0
Context | JSCContext represents a JavaScript execution context, where all operations take place and where the values will be associated. unstable since: 6.0
Exception | JSCException represents a JavaScript exception. unstable since: 6.0
Value | JSCValue represents a reference to a value in a `JSCContext`. The JSCValue protects the referenced value from being garbage collected. unstable since: 6.0
VirtualMachine | JSCVirtualMachine represents a group of JSCContexts. It allows concurrent JavaScript execution by creating a different instance of JSCVirtualMachine in each thread. unstable since: 6.0
WeakValue | 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. unstable since: 6.0

#### Structs

ClassVTable | 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. unstable since: 6.0

#### Enumerations

CheckSyntaxMode | Enum values to specify a mode to check for syntax errors in jsc_context_check_syntax(). unstable since: 6.0
CheckSyntaxResult | Enum values to specify the result of jsc_context_check_syntax(). unstable since: 6.0
OptionType | Enum values for options types. since: 2.24
TypedArrayType | Possible types of the elements contained in a typed array. since: 2.38

#### Bitfields

ValuePropertyFlags | Flags used when defining properties with `jsc_value_object_define_property_data()` and jsc_value_object_define_property_accessor(). unstable since: 6.0

#### Callbacks

ClassDeletePropertyFunction | The type of delete_property in `JSCClassVTable`. This is only required when you need to handle external properties not added to the prototype. unstable since: 6.0
ClassEnumeratePropertiesFunction | The type of enumerate_properties in `JSCClassVTable`. This is only required when you need to handle external properties not added to the prototype. unstable since: 6.0
ClassGetPropertyFunction | The type of get_property in `JSCClassVTable`. This is only required when you need to handle external properties not added to the prototype. unstable since: 6.0
ClassHasPropertyFunction | The type of has_property in `JSCClassVTable`. This is only required when you need to handle external properties not added to the prototype. unstable since: 6.0
ClassSetPropertyFunction | The type of set_property in `JSCClassVTable`. This is only required when you need to handle external properties not added to the prototype. unstable since: 6.0
ExceptionHandler | Function used to handle JavaScript exceptions in a `JSCContext`. unstable since: 6.0
Executor | A function passed to `jsc_value_new_promise` called during initialization. since: 2.48
OptionsFunc | Function used to iterate options. since: 2.24

#### Functions

get_major_version | Returns the major version number of the JavaScriptCore library. (e.g. in JavaScriptCore version 1.8.3 this is 1.) unstable since: 6.0
get_micro_version | Returns the micro version number of the JavaScriptCore library. (e.g. in JavaScriptCore version 1.8.3 this is 3.) unstable since: 6.0
get_minor_version | Returns the minor version number of the JavaScriptCore library. (e.g. in JavaScriptCore version 1.8.3 this is 8.) unstable since: 6.0
options_foreach | Iterates all available options calling `function` for each one. Iteration can stop early if `function` returns `FALSE`. since: 2.24
options_get_boolean | Get `option` as a #gboolean value. since: 2.24
options_get_double | Get `option` as a #gdouble value. since: 2.24
options_get_int | Get `option` as a #gint value. since: 2.24

options_get_option_group

Create a `GOptionGroup` to handle JSCOptions as command line arguments. The options will be exposed as command line arguments with the form <emphasis>—jsc-<option>=<value></emphasis>. Each entry in the returned `GOptionGroup` is configured to apply the corresponding option during command line parsing. Applications only need to pass the returned group to g_option_context_add_group(), and the rest will be taken care for automatically.

since: 2.24

options_get_range_string | Get `option` as a range string. The string must be in the format <emphasis>[!]<low>[:<high>]</emphasis> where low and high are #guint values. Values between low and high (both included) will be considered in the range, unless <emphasis>!</emphasis> is used to invert the range. since: 2.24
options_get_size | Get `option` as a #gsize value. since: 2.24
options_get_string | Get `option` as a string. since: 2.24
options_get_uint | Get `option` as a #guint value. since: 2.24
options_set_boolean | Set `option` as a #gboolean value. since: 2.24
options_set_double | Set `option` as a #gdouble value. since: 2.24
options_set_int | Set `option` as a #gint value. since: 2.24
options_set_range_string | Set `option` as a range string. The string must be in the format <emphasis>[!]<low>[:<high>]</emphasis> where low and high are #guint values. Values between low and high (both included) will be considered in the range, unless <emphasis>!</emphasis> is used to invert the range. since: 2.24
options_set_size | Set `option` as a #gsize value. since: 2.24
options_set_string | Set `option` as a string. since: 2.24
options_set_uint | Set `option` as a #guint value. since: 2.24

#### Function Macros

CHECK_VERSION | Check the version of JSC header files at compile time. unstable since: 6.0
DECLARE_FINAL_TYPE | unstable since: 6.0

#### Constants

MAJOR_VERSION | Like jsc_get_major_version(), but from the headers used at application compile time, rather than from the library linked against at application run time. unstable since: 6.0
MICRO_VERSION | Like jsc_get_micro_version(), but from the headers used at application compile time, rather than from the library linked against at application run time. unstable since: 6.0
MINOR_VERSION | Like jsc_get_minor_version(), but from the headers used at application compile time, rather than from the library linked against at application run time. unstable since: 6.0
OPTIONS_USE_DFG | Allows the DFG JIT to be used if `TRUE`. Option type: `JSC_OPTION_BOOLEAN` Default value: `TRUE`. unstable since: 6.0
OPTIONS_USE_FTL | Allows the FTL JIT to be used if `TRUE`. Option type: `JSC_OPTION_BOOLEAN` Default value: `TRUE`. unstable since: 6.0
OPTIONS_USE_JIT | Allows the executable pages to be allocated for JIT and thunks if `TRUE`. Option type: `JSC_OPTION_BOOLEAN` Default value: `TRUE`. unstable since: 6.0
OPTIONS_USE_LLINT | Allows the LLINT to be used if `TRUE`. Option type: `JSC_OPTION_BOOLEAN` Default value: `TRUE`. unstable since: 6.0