Skip to main content

Module jsapi

Module jsapi 

Source

Modules§

JS
__gnu_cxx
__pstl
fmt
glue
js
mozilla
std

Structs§

Flow
InfallibleAllocPolicy
IterImpl
JSAtom
JSAtomState
JSAutoNullableRealm
JSAutoRealm
JSAutoStructuredCloneBuffer
The C-style API calls to read and write structured clones are fragile – they rely on the caller to properly handle ownership of the clone data, and the handling of the input data as well as the interpretation of the contents of the clone buffer are dependent on the callbacks passed in. If you serialize and deserialize with different callbacks, the results are questionable.
JSClass
JSClassOps
JSConstScalarSpec
JSContext
JSErrorBase
Base class that implements parts shared by JSErrorReport and JSErrorNotes::Note.
JSErrorFormatString
JSErrorInterceptor
Callback used to intercept JavaScript errors.
JSErrorInterceptor__bindgen_vtable
JSErrorNotes
Notes associated with JSErrorReport.
JSErrorNotes_Note
JSErrorNotes_iterator
JSErrorReport
Describes a single error or warning that occurs in the execution of script.
JSExternalStringCallbacks
Each external string has a pointer to JSExternalStringCallbacks. Embedders can use this to implement custom finalization or memory reporting behavior.
JSExternalStringCallbacks__bindgen_vtable
JSFunction
JSFunctionSpec
JSFunctionSpecWithHelp
JSInfallibleAllocPolicy
JSJitGetterCallArgs
A class, expected to be passed by value, which represents the CallArgs for a JSJitGetterOp.
JSJitInfo
This struct contains metadata passed from the DOM to the JS Engine for JIT optimizations on DOM property accessors.
JSJitMethodCallArgs
JSJitMethodCallArgsTraits
JSJitSetterCallArgs
A class, expected to be passed by value, which represents the CallArgs for a JSJitSetterOp.
JSLinearString
JSNativeWrapper
Wrapper to relace JSNative for JSPropertySpecs and JSFunctionSpecs. This will allow us to pass one JSJitInfo per function with the property/function spec, without additional field overhead.
JSObject
JSPrincipals
JSPrincipals_RefCount
JSPrincipals__bindgen_vtable
JSPropertySpec
Description of a property. JS_DefineProperties and JS_InitClass take arrays of these and define many properties at once. JS_PSG, JS_PSGS and JS_PS_END are helper macros for defining such arrays.
JSPropertySpec_AccessorsOrValue_Accessors
JSPropertySpec_SelfHostedWrapper
JSPropertySpec_ValueWrapper
JSRuntime
JSScript
JSSecurityCallbacks
JSString
JSStructuredCloneCallbacks
JSStructuredCloneData
JSStructuredCloneData represents structured clone data together with the information needed to read/write/transfer/free the records within it, in the form of a set of callbacks.
JSStructuredCloneReader
JSStructuredCloneWriter
JSTracer
JSTracer__bindgen_vtable
JSTypedMethodJitInfo
JSWrapObjectCallbacks
ProfilingStack
RefPtr
RefPtr_ConstRemovingRefPtrTraits
RefPtr_Proxy
_IO_FILE
_IO_codecvt
_IO_marker
_IO_wide_data
__BindgenBitfieldUnit
__BindgenOpaqueArray
If Bindgen could only determine the size and alignment of a type, it is represented like this.
__pthread_internal_list
__pthread_mutex_s
__pthread_rwlock_arch_t
__va_list_tag
_bindgen_ty_69
already_AddRefed
already_AddRefed cooperates with reference counting smart pointers to enable you to assign in a pointer without |AddRef|ing it. You might want to use this as a return type from a function that returns an already |AddRef|ed pointer. Or, you might want to use this as a parameter type in a function that wants to force a transfer-of-ownership from a RefPtr in the caller (for example, if the function expects callers to pass in a newly-created object, which the function then takes ownership of).
nsISupports

Enums§

JSErrNum
JSExnType
Possible exception types. These types are part of a JSErrorFormatString structure. They define which error to throw in case of a runtime error.
JSFinalizeStatus
JSGCParamKey
JSGCStatus
JSJitCompilerOption
JSJitInfo_AliasSet
An enum that describes what this getter/setter/method aliases. This determines what things can be hoisted past this call, and if this call is movable what it can be hoisted past.
JSJitInfo_ArgType
JSJitInfo_OpType
JSPropertySpec_Kind
JSPropertySpec_ValueWrapper_Type
JSProtoKey
JSType
JSValueShiftedTag
JSValueTag
JSValueType
JSWhyMagic
OwnTransferablePolicy

Constants§

JSCLASS_BACKGROUND_FINALIZE
JSCLASS_CACHED_PROTO_MASK
JSCLASS_CACHED_PROTO_SHIFT
JSCLASS_DELAY_METADATA_BUILDER
JSCLASS_EMULATES_UNDEFINED
JSCLASS_FOREGROUND_FINALIZE
JSCLASS_GLOBAL_APPLICATION_SLOTS
JSCLASS_GLOBAL_FLAGS
JSCLASS_GLOBAL_SLOT_COUNT
JSCLASS_HAS_XRAYED_CONSTRUCTOR
JSCLASS_HIGH_FLAGS_SHIFT
JSCLASS_INTERNAL_FLAG1
JSCLASS_INTERNAL_FLAG2
JSCLASS_IS_DOMJSCLASS
JSCLASS_IS_GLOBAL
JSCLASS_IS_PROXY
JSCLASS_IS_WRAPPED_NATIVE
JSCLASS_PRESERVES_WRAPPER
JSCLASS_RESERVED_SLOTS_MASK
JSCLASS_RESERVED_SLOTS_SHIFT
JSCLASS_RESERVED_SLOTS_WIDTH
JSCLASS_SKIP_NURSERY_FINALIZE
JSCLASS_SLOT0_IS_NSISUPPORTS
JSCLASS_USERBIT1
JSCLASS_USERBIT2
JSCLASS_USERBIT3
JSClass_NON_NATIVE
JSFUN_CONSTRUCTOR
JSFUN_FLAGS_MASK
JSITER_FORAWAITOF
JSITER_HIDDEN
JSITER_OWNONLY
JSITER_PRIVATE
JSITER_SYMBOLS
JSITER_SYMBOLSONLY
JSJitInfo_AliasSetBits
JSJitInfo_OpTypeBits
JSJitInfo_ReturnTypeBits
JSJitInfo_SlotIndexBits
JSJitInfo_maxSlotIndex
JSJitMethodCallArgsTraits_offsetOfArgc
JSJitMethodCallArgsTraits_offsetOfArgv
JSPROP_ENUMERATE
The property is visible in for/in loops.
JSPROP_FLAGS_MASK
JSPROP_PERMANENT
The property is non-configurable: it can’t be deleted, and if it’s an accessor descriptor, its getter and setter can’t be changed.
JSPROP_READONLY
The property is non-writable. This flag is only valid for data properties.
JSPROP_RESOLVING
Resolve hooks and enumerate hooks must pass this flag when calling JS_Define* APIs to reify lazily-defined properties.
JSStructuredCloneData_kStandardCapacity
JS_64BIT
JS_BITS_PER_WORD
JS_CODEGEN_X64
JS_DEFAULT_JITREPORT_GRANULARITY
JS_HAS_INTL_API
JS_OBJECT_WRAPPER_SLOT
JS_PUNBOX64
JS_SCERR_DUP_TRANSFERABLE
JS_SCERR_NOT_CLONABLE
JS_SCERR_NOT_CLONABLE_WITH_COOP_COEP
JS_SCERR_RECURSION
JS_SCERR_SHMEM_TRANSFERABLE
JS_SCERR_TRANSFERABLE
JS_SCERR_TRANSFERABLE_TWICE
JS_SCERR_TYPED_ARRAY_DETACHED
JS_SCERR_UNSUPPORTED_TYPE
JS_SCERR_WASM_NO_TRANSFER
JS_STANDALONE
JS_STRUCTURED_CLONE_VERSION
JS_WITHOUT_NSPR

Statics§

JS_NULL_CLASS_EXT⚠
JS_NULL_CLASS_OPS⚠
JS_NULL_CLASS_SPEC⚠
JS_NULL_OBJECT_OPS⚠

Functions§

JS_AbortIfWrongThread⚠
A JS context always has an “owner thread”. The owner thread is set when the context is created (to the current thread) and practically all entry points into the JS engine check that a context (or anything contained in the context: runtime, compartment, object, etc) is only touched by its owner thread. Embeddings may check this invariant outside the JS engine by calling JS_AbortIfWrongThread (which will abort if not on the owner thread, even for non-debug builds).
JS_AddExtraGCRootsTracer⚠
Register externally maintained GC roots.
JS_AddFinalizeCallback⚠
JS_AddInterruptCallback⚠
JS_AddWeakPointerCompartmentCallback⚠
JS_AddWeakPointerZonesCallback⚠
JS_AlreadyHasOwnElement⚠
JS_AlreadyHasOwnProperty⚠
JS_AlreadyHasOwnPropertyById⚠
JS_AlreadyHasOwnUCProperty⚠
JS_Assert⚠
JS_AssignObject⚠
Equivalent to Object.assign(target, src): Copies the properties from the src object (which must not be null) to target (which also must not be null).
JS_AtomizeAndPinString⚠
JS_AtomizeAndPinStringN⚠
JS_AtomizeString⚠
JS_AtomizeStringN⚠
JS_AtomizeUCString⚠
JS_AtomizeUCStringN⚠
JS_CallFunction⚠
JS_CallFunctionName⚠
Perform the method call rval = obj[name](args).
JS_CallFunctionValue⚠
Call a function, passing a this-value and arguments. This is the C++ equivalent of rval = Reflect.apply(fun, obj, args).
JS_CharsToId⚠
Convert chars into a jsid.
JS_CheckForInterrupt⚠
JS_ClearPendingException⚠
JS_CompareStrings⚠
JS_ConcatStrings⚠
Concatenate two strings, possibly resulting in a rope. See above for thread safety comments.
JS_CopyStringChars⚠
JS_CopyStringCharsZ⚠
Copies the string’s characters to a null-terminated char16_t buffer.
JS_DecodeBytes⚠
For JS_DecodeBytes, set *dstlenp to the size of the destination buffer before the call; on return, *dstlenp contains the number of characters actually stored. To determine the necessary destination buffer size, make a sizing call that passes nullptr for dst.
JS_DecompileFunction⚠
JS_DecompileScript⚠
JS_DeepFreezeObject⚠
Freeze obj, and all objects it refers to, recursively. This will not recurse through non-extensible objects, on the assumption that those are already deep-frozen.
JS_DefineDebuggerObject⚠
JS_DefineElement⚠
JS_DefineElement1⚠
JS_DefineElement2⚠
JS_DefineElement3⚠
JS_DefineElement4⚠
JS_DefineElement5⚠
JS_DefineElement6⚠
JS_DefineFunction⚠
JS_DefineFunctionById⚠
JS_DefineFunctions⚠
JS_DefineFunctionsWithHelp⚠
JS_DefineObject⚠
Other property-defining functions
JS_DefineProfilingFunctions⚠
Add various profiling-related functions as properties of the given object. Defined in builtin/Profilers.cpp.
JS_DefineProperties⚠
JS_DefineProperty⚠
JS_DefineProperty1⚠
JS_DefineProperty2⚠
JS_DefineProperty3⚠
JS_DefineProperty4⚠
JS_DefineProperty5⚠
JS_DefineProperty6⚠
JS_DefineProperty7⚠
JS_DefinePropertyById⚠
Define a property on obj.
JS_DefinePropertyById1⚠
Define a property on obj, throwing a TypeError if the attempt fails. This is the C++ equivalent of Object.defineProperty(obj, id, desc).
JS_DefinePropertyById2⚠
JS_DefinePropertyById3⚠
JS_DefinePropertyById4⚠
JS_DefinePropertyById5⚠
JS_DefinePropertyById6⚠
JS_DefinePropertyById7⚠
JS_DefinePropertyById8⚠
JS_DefinePropertyById9⚠
JS_DefineUCFunction⚠
JS_DefineUCProperty⚠
JS_DefineUCProperty1⚠
JS_DefineUCProperty2⚠
JS_DefineUCProperty3⚠
JS_DefineUCProperty4⚠
JS_DefineUCProperty5⚠
JS_DefineUCProperty6⚠
JS_DefineUCProperty7⚠
JS_DefineUCProperty8⚠
JS_DeleteElement⚠
JS_DeleteElement1⚠
JS_DeleteProperty⚠
JS_DeleteProperty1⚠
JS_DeletePropertyById⚠
Delete a property. This is the C++ equivalent of result = Reflect.deleteProperty(obj, id).
JS_DeletePropertyById1⚠
Delete a property, ignoring strict failures. This is the C++ equivalent of the JS delete obj[id] in non-strict mode code.
JS_DeleteUCProperty⚠
JS_DeprecatedStringHasLatin1Chars⚠
DO NOT USE, only present for Rust bindings as a temporary hack
JS_DestroyContext⚠
JS_DisableInterruptCallback⚠
JS_DoubleIsInt32⚠
JS_DropPrincipals⚠
JS_EncodeStringToASCII⚠
DEPRECATED
JS_EncodeStringToBuffer⚠
Encode string into a buffer. The function does not stores an additional zero byte. The function returns (size_t) -1 if the string can not be encoded into bytes with no error reported. Otherwise it returns the number of bytes that are necessary to encode the string. If that exceeds the length parameter, the string will be cut and only length bytes will be written into the buffer.
JS_EncodeStringToLatin1⚠
DEPRECATED
JS_EncodeStringToUTF8⚠
DEPRECATED
JS_EnsureLinearString⚠
JS_Enumerate⚠
Get an array of the non-symbol enumerable properties of obj. This function is roughly equivalent to:
JS_EnumerateStandardClasses⚠
JS_ErrorFromException⚠
If the given object is an exception object, the exception will have (or be able to lazily create) an error report struct, and this function will populate |errorReport| with it and return true. Otherwise, returns false.
JS_ExecuteScript⚠
Evaluate a script in the scope of the current global of cx.
JS_ExecuteScript1⚠
JS_ExecuteScript2⚠
As above, but providing an explicit scope chain. envChain must not include the global object on it; that’s implicit. It needs to contain the other objects that should end up on the script’s scope chain.
JS_ExecuteScript3⚠
JS_ExpandErrorArgumentsASCII⚠
JS_ExtensibleLexicalEnvironment⚠
JS_FindCompilationScope⚠
JS_FireOnNewGlobalObject⚠
JS_ForwardGetElementTo⚠
JS_ForwardGetPropertyTo⚠
Get the value of the property obj[id], or undefined if no such property exists. This is the C++ equivalent of vp = Reflect.get(obj, id, receiver).
JS_ForwardSetPropertyTo⚠
Perform the same property assignment as Reflect.set(obj, id, v, receiver).
JS_FreezeObject⚠
Freezes an object; see ES5’s Object.freeze(obj) method.
JS_FrontendOnlyShutDown⚠
A variant of JS_ShutDown for process which used JS_FrontendOnlyInit instead of JS_Init.
JS_GC⚠
JS_GetArrayBufferViewBuffer⚠
Return the ArrayBuffer or SharedArrayBuffer underlying an ArrayBufferView. This may return a detached buffer. |obj| must be an object that would return true for JS_IsArrayBufferViewObject().
JS_GetArrayBufferViewByteLength⚠
More generic name for JS_GetTypedArrayByteLength to cover DataViews as well
JS_GetArrayBufferViewByteOffset⚠
More generic name for JS_GetTypedArrayByteOffset to cover DataViews as well
JS_GetArrayBufferViewData⚠
Same as above, but for any kind of ArrayBufferView. Prefer the type-specific versions when possible.
JS_GetArrayBufferViewFixedData⚠
Return a “fixed” pointer (one that will not move during a GC) to the ArrayBufferView’s data. Note that this will not keep the object alive; the holding object should be rooted or traced. If the view is storing the data inline, this will copy the data to the provided buffer, returning nullptr if bufSize is inadequate.
JS_GetArrayBufferViewType⚠
JS_GetBigInt64ArrayData⚠
JS_GetBigUint64ArrayData⚠
JS_GetBoundFunctionTarget⚠
JS_GetClassObject⚠
JS_GetClassPrototype⚠
JS_GetCompartmentPrivate⚠
JS_GetConstructor⚠
JS_GetContextPrivate⚠
JS_GetElement⚠
JS_GetEmptyString⚠
JS_GetErrorInterceptorCallback⚠
JS_GetExternalStringCallbacks⚠
Return the ‘callbacks’ arg passed to JS_NewExternalStringLatin1, JS_NewExternalUCString, JS_NewMaybeExternalStringLatin1, or JS_NewMaybeExternalUCString.
JS_GetFloat16ArrayData⚠
JS_GetFloat32ArrayData⚠
JS_GetFloat64ArrayData⚠
JS_GetFunctionArity⚠
JS_GetFunctionDisplayId⚠
Return a function’s display name as name out-parameter.
JS_GetFunctionId⚠
Return the function’s identifier as a JSString, or null if fun is unnamed.
JS_GetFunctionLength⚠
JS_GetFunctionObject⚠
JS_GetFunctionScript⚠
JS_GetGCParameter⚠
JS_GetGlobalFromScript⚠
JS_GetGlobalJitCompilerOption⚠
JS_GetImplementationVersion⚠
JS_GetInt8ArrayData⚠
JS_GetInt16ArrayData⚠
JS_GetInt32ArrayData⚠
JS_GetLastOOMStackTrace⚠
JS_GetLatin1StringCharsAndLength⚠
JS_GetMaybePartialFunctionDisplayId⚠
Almost same as JS_GetFunctionDisplayId.
JS_GetMaybePartialFunctionId⚠
Almost same as JS_GetFunctionId.
JS_GetObjectAsArrayBufferView⚠
JS_GetObjectAsBigInt64Array⚠
JS_GetObjectAsBigUint64Array⚠
JS_GetObjectAsFloat16Array⚠
JS_GetObjectAsFloat32Array⚠
JS_GetObjectAsFloat64Array⚠
JS_GetObjectAsInt8Array⚠
JS_GetObjectAsInt16Array⚠
JS_GetObjectAsInt32Array⚠
JS_GetObjectAsUint8Array⚠
JS_GetObjectAsUint8ClampedArray⚠
JS_GetObjectAsUint16Array⚠
JS_GetObjectAsUint32Array⚠
JS_GetObjectFunction⚠
JS_GetParentRuntime⚠
JS_GetPendingException⚠
JS_GetProperty⚠
JS_GetPropertyById⚠
Get the value of the property obj[id], or undefined if no such property exists. The result is stored in vp.
JS_GetPrototype⚠
Get the prototype of |obj|, storing it in |proto|.
JS_GetPrototypeIfOrdinary⚠
If |obj| (underneath any functionally-transparent wrapper proxies) has as its [[GetPrototypeOf]] trap the ordinary [[GetPrototypeOf]] behavior defined for ordinary objects, set |*isOrdinary = true| and store |obj|’s prototype in |result|. Otherwise set |*isOrdinary = false|. In case of error, both outparams have unspecified value.
JS_GetRuntime⚠
JS_GetScriptBaseLineNumber⚠
JS_GetScriptFilename⚠
JS_GetScriptPrincipals⚠
JS_GetSecurityCallbacks⚠
JS_GetStringCharAt⚠
JS_GetStringEncodingLength⚠
Get number of bytes in the string encoding (without accounting for a terminating zero bytes. The function returns (size_t) -1 if the string can not be encoded into bytes and reports an error using cx accordingly.
JS_GetStringLength⚠
JS_GetStructuredCloneScope⚠
JS_GetTwoByteExternalStringChars⚠
JS_GetTwoByteStringCharsAndLength⚠
JS_GetTypedArrayByteLength⚠
Return the byte length of a typed array.
JS_GetTypedArrayByteOffset⚠
Return the byte offset from the start of an ArrayBuffer to the start of a typed array view.
JS_GetTypedArrayLength⚠
Return the number of elements in a typed array.
JS_GetTypedArraySharedness⚠
Return the isShared flag of a typed array, which denotes whether the underlying buffer is a SharedArrayBuffer.
JS_GetUCProperty⚠
JS_GetUint8ArrayData⚠
JS_GetUint8ClampedArrayData⚠
JS_GetUint16ArrayData⚠
JS_GetUint32ArrayData⚠
JS_GetZoneUserData⚠
JS_GlobalLexicalEnvironment⚠
JS_GlobalObjectTraceHook⚠
Spidermonkey does not have a good way of keeping track of what compartments should be marked on their own. We can mark the roots unconditionally, but marking GC things only relevant in live compartments is hard. To mitigate this, we create a static trace hook, installed on each global object, from which we can be sure the compartment is relevant, and mark it.
JS_HasElement⚠
JS_HasExtensibleLexicalEnvironment⚠
JS_HasInstance⚠
JS_HasOwnProperty⚠
JS_HasOwnPropertyById⚠
Determine whether obj has an own property with the key id.
JS_HasProperty⚠
JS_HasPropertyById⚠
Compute the expression id in obj.
JS_HasUCProperty⚠
JS_HoldPrincipals⚠
JS_IdToProtoKey⚠
JS_IdToValue⚠
JS_IndexToId⚠
Convert a uint32_t index into a jsid.
JS_InitClass⚠
Defines a builtin constructor and prototype. Returns the prototype object.
JS_InitDestroyPrincipalsCallback⚠
JS_InitReadPrincipalsCallback⚠
JS_InitReflectParse⚠
Add ‘Reflect.parse’, a SpiderMonkey extension, to the Reflect object on the given global.
JS_InitReservedSlot⚠
JS_InitializePropertiesFromCompatibleNativeObject⚠
Copy the own properties of src to dst in a fast way. src and dst must both be native and must be in the compartment of cx. They must have the same class, the same parent, and the same prototype. Class reserved slots will NOT be copied.
JS_InstanceOf⚠
JS_IsArrayBufferViewObject⚠
Check whether obj supports JS_GetArrayBufferView* APIs. Note that this may return false if a security wrapper is encountered that denies the unwrapping. If this test or one of the more specific tests succeeds, then it is safe to call the various ArrayBufferView accessor JSAPI calls defined below.
JS_IsBuiltinEvalFunction⚠
True iff fun is the global eval function.
JS_IsBuiltinFunctionConstructor⚠
True iff fun is the Function constructor.
JS_IsConstructor⚠
Return whether the given function is a valid constructor.
JS_IsDeadWrapper⚠
Determine whether the given object is backed by a DeadObjectProxy.
JS_IsExceptionPending⚠
JS_IsExtensible⚠
Determine whether obj is extensible. Extensible objects can have new properties defined on them. Inextensible objects can’t, and their [[Prototype]] slot is fixed as well.
JS_IsGlobalObject⚠
JS_IsIdentifier⚠
Test if the given string is a valid ECMAScript identifier
JS_IsIdentifier1⚠
Test whether the given chars + length are a valid ECMAScript identifier. This version is infallible, so just returns whether the chars are an identifier.
JS_IsNative⚠
JS_IsNativeFunction⚠
JS_IsThrowingOutOfMemory⚠
JS_IsTypedArrayObject⚠
Check whether obj supports JS_GetTypedArray* APIs. Note that this may return false if a security wrapper is encountered that denies the unwrapping. If this test or one of the JS_Is*Array tests succeeds, then it is safe to call the various accessor JSAPI calls defined below.
JS_IterateCompartments⚠
This function calls |compartmentCallback| on every compartment until either all compartments have been iterated or CompartmentIterResult::Stop is returned. Beware that there is no guarantee that the compartment will survive after the callback returns. Also, barriers are disabled via the TraceSession.
JS_IterateCompartmentsInZone⚠
This function calls |compartmentCallback| on every compartment in the given zone until either all compartments have been iterated or CompartmentIterResult::Stop is returned. Beware that there is no guarantee that the compartment will survive after the callback returns. Also, barriers are disabled via the TraceSession.
JS_LinearStringEqualsAscii⚠
JS_LinearStringEqualsAscii1⚠
JS_LinkConstructorAndPrototype⚠
Set up ctor.prototype = proto and proto.constructor = ctor with the right property flags.
JS_MarkCrossZoneId⚠
Mark a jsid after entering a new compartment. Different zones separately mark the ids in a runtime, and this must be used any time an id is obtained from one compartment and then used in another compartment, unless the two compartments are guaranteed to be in the same zone.
JS_MarkCrossZoneIdValue⚠
If value stores a jsid (an atomized string or symbol), mark that id as for JS_MarkCrossZoneId.
JS_MaxMovableTypedArraySize⚠
If the bufSize passed to JS_GetArrayBufferViewFixedData is at least this many bytes, then any copied data is guaranteed to fit into the provided buffer.
JS_MayResolveStandardClass⚠
JS_MaybeGC⚠
JS_NewBigInt64Array⚠
JS_NewBigInt64ArrayFromArray⚠
JS_NewBigInt64ArrayWithBuffer⚠
JS_NewBigUint64Array⚠
JS_NewBigUint64ArrayFromArray⚠
JS_NewBigUint64ArrayWithBuffer⚠
JS_NewContext⚠
JS_NewDataView⚠
Create a new DataView using the given buffer for storage. The given buffer must be an ArrayBuffer or SharedArrayBuffer (or a cross-compartment wrapper of either type), and the offset and length must fit within the bounds of the buffer. Currently, nullptr will be returned and an exception will be thrown if these conditions do not hold, but do not depend on that behavior.
JS_NewDeadWrapper⚠
Creates a new dead wrapper object in the given scope. To be used when attempting to wrap objects from scopes which are already dead.
JS_NewDependentString⚠
Create a dependent string, i.e., a string that owns no character storage, but that refers to a slice of another string’s chars. Dependent strings are mutable by definition, so the thread safety comments above apply.
JS_NewEnumerateStandardClasses⚠
Fill “properties” with a list of standard class names that have not yet been resolved on “obj”. This can be used as (part of) a newEnumerate class hook on a global. Already-resolved things are excluded because they might have been deleted by script after being resolved and enumeration considers already-defined properties anyway.
JS_NewEnumerateStandardClassesIncludingResolved⚠
Fill “properties” with a list of standard class names. This can be used for proxies that want to define behavior that looks like enumerating a global without touching the global itself.
JS_NewExternalStringLatin1⚠
Create a new JSString whose chars member refers to external memory, i.e., memory requiring application-specific finalization.
JS_NewExternalUCString⚠
JS_NewFloat16Array⚠
JS_NewFloat16ArrayFromArray⚠
JS_NewFloat16ArrayWithBuffer⚠
JS_NewFloat32Array⚠
JS_NewFloat32ArrayFromArray⚠
JS_NewFloat32ArrayWithBuffer⚠
JS_NewFloat64Array⚠
JS_NewFloat64ArrayFromArray⚠
JS_NewFloat64ArrayWithBuffer⚠
JS_NewFunction⚠
JS_NewGlobalObject⚠
JS_NewInt8Array⚠
JS_NewInt8ArrayFromArray⚠
JS_NewInt8ArrayWithBuffer⚠
JS_NewInt16Array⚠
JS_NewInt16ArrayFromArray⚠
JS_NewInt16ArrayWithBuffer⚠
JS_NewInt32Array⚠
JS_NewInt32ArrayFromArray⚠
JS_NewInt32ArrayWithBuffer⚠
JS_NewMaybeExternalStringLatin1⚠
Create a new JSString whose chars member may refer to external memory. If a new external string is allocated, |*allocatedExternal| is set to true. Otherwise the returned string is either not an external string or an external string allocated by a previous call and |*allocatedExternal| is set to false. If |*allocatedExternal| is false, |fin| won’t be called.
JS_NewMaybeExternalStringUTF8⚠
Similar to JS_NewMaybeExternalStringLatin1.
JS_NewMaybeExternalUCString⚠
JS_NewObject⚠
JS_NewObjectForConstructor⚠
A constructor can request that the JS engine create a default new ‘this’ object of the given class, using the callee to determine parentage and [[Prototype]].
JS_NewObjectWithGivenProto⚠
Unlike JS_NewObject, JS_NewObjectWithGivenProto does not compute a default proto. If proto is nullptr, the JS object will have null as [[Prototype]].
JS_NewObjectWithoutMetadata⚠
Allocate an object in exactly the same way as JS_NewObjectWithGivenProto, but without invoking the metadata callback on it. This allows creation of internal bookkeeping objects that are guaranteed to not have metadata attached to them.
JS_NewPlainObject⚠
Creates a new plain object, like new Object(), with Object.prototype as [[Prototype]].
JS_NewStringCopyN⚠
JS_NewStringCopyUTF8N⚠
JS_NewStringCopyUTF8Z⚠
JS_NewStringCopyZ⚠
JS_NewUCStringCopyN⚠
JS_NewUCStringCopyZ⚠
JS_NewUint8Array⚠
JS_NewUint8ArrayFromArray⚠
JS_NewUint8ArrayWithBuffer⚠
JS_NewUint8ClampedArray⚠
JS_NewUint8ClampedArrayFromArray⚠
JS_NewUint8ClampedArrayWithBuffer⚠
JS_NewUint16Array⚠
JS_NewUint16ArrayFromArray⚠
JS_NewUint16ArrayWithBuffer⚠
JS_NewUint32Array⚠
JS_NewUint32ArrayFromArray⚠
JS_NewUint32ArrayWithBuffer⚠
JS_NondeterministicGetWeakMapKeys⚠
JS_NondeterministicGetWeakSetKeys⚠
JS_Now⚠
Microseconds since the epoch, midnight, January 1, 1970 UTC.
JS_ObjectIsBoundFunction⚠
JS_ObjectIsFunction⚠
Infallible predicate to test whether obj is a function object (faster than comparing obj’s class name to “Function”, but equivalent unless someone has overwritten the “Function” identifier with a different constructor and then created instances using that constructor that might be passed in as obj).
JS_ObjectNotWritten⚠
JS_ParseJSON⚠
Performs the JSON.parse operation as specified by ECMAScript.
JS_ParseJSON1⚠
Performs the JSON.parse operation as specified by ECMAScript.
JS_ParseJSON2⚠
Performs the JSON.parse operation as specified by ECMAScript.
JS_ParseJSONWithReviver⚠
Performs the JSON.parse operation as specified by ECMAScript, using the given |reviver| argument as the corresponding optional argument to that function.
JS_ParseJSONWithReviver1⚠
Performs the JSON.parse operation as specified by ECMAScript, using the given |reviver| argument as the corresponding optional argument to that function.
JS_PreventExtensions⚠
Attempt to make |obj| non-extensible.
JS_PutEscapedLinearString⚠
JS_PutEscapedString⚠
JS_ReadBytes⚠
JS_ReadDouble⚠
JS_ReadString⚠
JS_ReadStructuredClone⚠
Implements StructuredDeserialize and StructuredDeserializeWithTransfer.
JS_ReadTypedArray⚠
JS_ReadUint32Pair⚠
JS_RefreshCrossCompartmentWrappers⚠
JS_RemoveExtraGCRootsTracer⚠
Undo a call to JS_AddExtraGCRootsTracer.
JS_RemoveFinalizeCallback⚠
JS_RemoveWeakPointerCompartmentCallback⚠
JS_RemoveWeakPointerZonesCallback⚠
JS_ReportAllocationOverflow⚠
Complain when an allocation size overflows the maximum supported limit.
JS_ReportErrorASCII⚠
Report an exception represented by the sprintf-like conversion of format and its arguments.
JS_ReportErrorLatin1⚠
JS_ReportErrorNumberASCII⚠
JS_ReportErrorNumberASCIIVA⚠
JS_ReportErrorNumberLatin1⚠
JS_ReportErrorNumberLatin1VA⚠
JS_ReportErrorNumberUC⚠
JS_ReportErrorNumberUCArray⚠
JS_ReportErrorNumberUTF8⚠
JS_ReportErrorNumberUTF8Array⚠
JS_ReportErrorNumberUTF8VA⚠
JS_ReportErrorUTF8⚠
JS_ReportOutOfMemory⚠
Complain when out of memory.
JS_RequestInterruptCallback⚠
JS_RequestInterruptCallbackCanWait⚠
JS_ResetGCParameter⚠
JS_ResetInterruptCallback⚠
JS_ResolveStandardClass⚠
Resolve id, which must contain either a string or an int, to a standard class name in obj if possible, defining the class’s constructor and/or prototype and storing true in *resolved. If id does not name a standard class or a top-level property induced by initializing a standard class, store false in *resolved and just return true. Return false on error, as usual for bool result-typed API entry points.
JS_ScriptHasMutedErrors⚠
JS_SetAllNonReservedSlotsToUndefined⚠
Assign ‘undefined’ to all of the object’s non-reserved slots. Note: this is done for all slots, regardless of the associated property descriptor.
JS_SetCompartmentPrivate⚠
JS_SetContextPrivate⚠
JS_SetDestroyCompartmentCallback⚠
JS_SetDestroyZoneCallback⚠
JS_SetElement⚠
JS_SetElement1⚠
JS_SetElement2⚠
JS_SetElement3⚠
JS_SetElement4⚠
JS_SetElement5⚠
JS_SetErrorInterceptorCallback⚠
JS_SetFutexCanWait⚠
JS_SetGCCallback⚠
JS_SetGCParameter⚠
JS_SetGCParametersBasedOnAvailableMemory⚠
JS_SetGlobalJitCompilerOption⚠
JS_SetICUMemoryFunctions⚠
This function can be used to track memory used by ICU. If it is called, it must be called before JS_Init. Don’t use it unless you know what you’re doing!
JS_SetImmutablePrototype⚠
Attempt to make the [[Prototype]] of |obj| immutable, such that any attempt to modify it will fail. If an error occurs during the attempt, return false (with a pending exception set, depending upon the nature of the error). If no error occurs, return true with |*succeeded| set to indicate whether the attempt successfully made the [[Prototype]] immutable.
JS_SetNativeStackQuota⚠
Set the size of the native stack that should not be exceed. To disable stack size checking pass 0.
JS_SetOffthreadBaselineCompilationEnabled⚠
JS_SetOffthreadIonCompilationEnabled⚠
JS_SetPendingException⚠
JS_SetProperty⚠
JS_SetPropertyById⚠
Perform the assignment obj[id] = v.
JS_SetPrototype⚠
Change the prototype of obj.
JS_SetReservedSlot⚠
JS_SetSecurityCallbacks⚠
JS_SetSizeOfIncludingThisCompartmentCallback⚠
JS_SetTrustedPrincipals⚠
JS_SetUCProperty⚠
JS_SetWrapObjectCallbacks⚠
JS_SetZoneUserData⚠
JS_ShutDown⚠
Destroy free-standing resources allocated by SpiderMonkey, not associated with any runtime, context, or other structure.
JS_StringEqualsAscii⚠
JS_StringEqualsAscii1⚠
JS_StringHasBeenPinned⚠
JS_StringIsLinear⚠
JS_StringToId⚠
JS_Stringify⚠
Performs the JSON.stringify operation, as specified by ECMAScript, except writing stringified data by exactly one call of |callback|, passing |data| as argument.
JS_StringifyWithLengthHint⚠
JS_StructuredClone⚠
JS_StructuredCloneHasTransferables⚠
JS_TracerEnterLabelLatin1⚠
JS_TracerEnterLabelTwoByte⚠
JS_TracerIsTracing⚠
JS_TracerLeaveLabelLatin1⚠
JS_TracerLeaveLabelTwoByte⚠
JS_TransplantObject⚠
JS_TypeOfValue⚠
JS_UpdateWeakPointerAfterGC⚠
JS_UpdateWeakPointerAfterGCUnbarriered⚠
JS_Utf8BufferIsCompilableUnit⚠
Given a buffer, return false if the buffer might become a valid JavaScript script with the addition of more lines, or true if the validity of such a script is conclusively known (because it’s the prefix of a valid script – and possibly the entirety of such a script).
JS_ValueToConstructor⚠
JS_ValueToFunction⚠
JS_ValueToId⚠
JS_ValueToObject⚠
JS_ValueToSource⚠
JS_WrapObject⚠
JS_WrapPropertyDescriptor⚠
JS_WrapPropertyDescriptor1⚠
JS_WrapValue⚠
JS_WriteBytes⚠
JS_WriteDouble⚠
JS_WriteString⚠
JS_WriteStructuredClone⚠
Implements StructuredSerialize, StructuredSerializeForStorage, and StructuredSerializeWithTransfer.
JS_WriteTypedArray⚠
JS_WriteUint32PairUnchecked⚠
Same as JS_WriteUint32Pair but let implicit conversions from integers of a wider range happen without performing bounds checks. Using this function directly is not recommended: it is here mainly to allow compiler optimizations in JS_WriteUint32Pair for cases where integer values are known at compile time (in which case .isValid() calls can be elided)
JS_free⚠
A wrapper for |js_free(p)| that may delay |js_free(p)| invocation as a performance optimization. |cx| may be nullptr.
JS_malloc⚠
JS_realloc⚠
JS_string_free⚠
JS_string_malloc⚠
Same as above, but for buffers that will be used with the BYOB (Bring Your Own Buffer) JSString creation functions, such as JS_NewLatin1String and JS_NewUCString
JS_string_realloc⚠

Type Aliases§

CanTransferStructuredCloneOp
Called when the transferring objects are checked. If this function returns false, the serialization ends throwing a DataCloneError exception.
FILE
FreeTransferStructuredCloneOp
Called when freeing a transferable handled by the embedding. Note that it should never trigger a garbage collection (and will assert in a debug build if it does.)
JSAddPropertyOp
Add a property named by id to obj.
JSCSPEvalChecker
JSCodeForEvalOp
JSConstDoubleSpec
JSConstIntegerSpec
JSDeletePropertyOp
Delete a property named by id in obj.
JSDestroyCompartmentCallback
JSDestroyPrincipalsOp
JSDestroyZoneCallback
JSEnumerateOp
The old-style JSClass.enumerate op should define all lazy properties not yet reflected in obj.
JSErrorCallback
JSErrorNotes_iterator_difference_type
JSErrorNotes_iterator_iterator_category
JSErrorNotes_iterator_pointer
JSErrorNotes_iterator_reference
JSErrorNotes_iterator_value_type
JSFinalizeCallback
JSFinalizeOp
Finalize obj, which the garbage collector has determined to be unreachable from other live objects or from GC roots. Obviously, finalizers must never store a reference to obj.
JSFunToStringOp
The type of ObjectOps::funToString. This callback allows an object to provide a custom string to use when Function.prototype.toString is invoked on that object. A null return value means OOM.
JSFunctionSpec_Name
JSGCCallback
JSHostCleanupFinalizationRegistryCallback
JSInterruptCallback
JSIterateCompartmentCallback
JSJitGetterOp
JSJitMethodCallArgs_Base
JSJitMethodOp
JSJitSetterOp
JSMayResolveOp
A class with a resolve hook can optionally have a mayResolve hook. This hook must have no side effects and must return true for a given id if the resolve hook may resolve this id. This is useful when we’re doing a “pure” lookup: if mayResolve returns false, we know we don’t have to call the effectful resolve hook.
JSNative
JSNewEnumerateOp
The type of ObjectOps::enumerate. This callback overrides a portion of SpiderMonkey’s default [[Enumerate]] internal method. When an ordinary object is enumerated, that object and each object on its prototype chain is tested for an enumerate op, and those ops are called in order. The properties each op adds to the ‘properties’ vector are added to the set of values the for-in loop will iterate over. All of this is nonstandard.
JSONWriteCallback
JSObjectMovedOp
JSPreWrapCallback
Callback used by the wrap hook to ask the embedding to prepare an object for wrapping in a context. This might include unwrapping other wrappers or even finding a more suitable object for the new compartment. If |origObj| is non-null, then it is the original object we are going to swap into during a transplant.
JSReadPrincipalsOp
JSResolveOp
Resolve a lazy property named by id in obj by defining it directly in obj. Lazy properties are those reflected from some peer native property space (e.g., the DOM attributes for a given node reflected as obj) on demand.
JSSizeOfIncludingThisCompartmentCallback
JSStructuredCloneData_BufferList
JSStructuredCloneData_Iterator
JSStructuredCloneData_StringBuffers
JSSubsumesOp
JSTraceDataOp
JSTraceOp
Function type for trace operation of the class called to enumerate all traceable things reachable from obj’s private data structure. For each such thing, a trace implementation must call JS::TraceEdge on the thing’s location.
JSWeakPointerCompartmentCallback
JSWeakPointerZonesCallback
JSWrapObjectCallback
Callback used to ask the embedding for the cross compartment wrapper handler that implements the desired prolicy for this kind of object in the destination compartment. |obj| is the object to be wrapped. If |existing| is non-nullptr, it will point to an existing wrapper object that should be re-used if possible. |existing| is guaranteed to be a cross-compartment wrapper with a lazily-defined prototype and the correct global. It is guaranteed not to wrap a function.
JS_ICUAllocFn
JS_ICUFreeFn
JS_ICUReallocFn
MozExternalRefCountType
MozRefCountType
MozRefCountType is Mozilla’s reference count type.
ReadStructuredCloneOp
Read structured data from the reader r. This hook is used to read a value previously serialized by a call to the WriteStructuredCloneOp hook.
ReadTransferStructuredCloneOp
This is called when JS_ReadStructuredClone receives a transferable object not known to the engine. If this hook does not exist or returns false, the JS engine calls the reportError op if set, otherwise it throws a DATA_CLONE_ERR DOM Exception. This method is called before any other callback and must return a non-null object in returnObject on success.
RefPtr_Proxy_member_function
RefPtr_element_type
SharedArrayBufferClonedOp
Called when a SharedArrayBuffer (including one owned by a Wasm memory object) has been processed in context cx by structured cloning. If receiving is true then the SAB has been received from a channel and a new SAB object has been created; if false then an existing SAB has been serialized onto a channel.
StructuredCloneErrorOp
This is called when serialization or deserialization encounters an error. To follow HTML5, the application must throw a DATA_CLONE_ERR DOMException with error set to one of the JS_SCERR_* values.
TransferStructuredCloneOp
Called when JS_WriteStructuredClone receives a transferable object not handled by the engine. If this hook does not exist or returns false, the JS engine will call the reportError hook or fall back to throwing a DATA_CLONE_ERR DOM Exception. This method is called before any other callback.
WriteStructuredCloneOp
Structured data serialization hook. The engine can write primitive values, Objects, Arrays, Dates, RegExps, TypedArrays, ArrayBuffers, Sets, Maps, and SharedTypedArrays. Any other type of object requires application support. This callback must first use the JS_WriteUint32Pair API to write an object header, passing a value greater than JS_SCTAG_USER to the tag parameter. Then it can use the JS_Write* APIs to write any other relevant parts of the value v to the writer w. closure is any value passed to the JS_WriteStructuredClone function.
_IO_lock_t
__builtin_va_list
__gnuc_va_list
__off64_t
__off_t
__pthread_list_t
arena_id_t
jsbytecode
jsid
uint_fast8_t
va_list

Unions§

JSJitInfo__bindgen_ty_1
JSJitInfo__bindgen_ty_2
JSJitInfo__bindgen_ty_3
JSPropertySpec_Accessor
JSPropertySpec_AccessorsOrValue
JSPropertySpec_Name
JSPropertySpec_ValueWrapper__bindgen_ty_1
pthread_mutex_t
pthread_rwlock_t