Module jsapi

Source

Modules§

JS
Scalar
__gnu_cxx
__pstl
dbg
detail
fmt
frontend
gc
gcstats
glue
jit
js
mozilla
oom
shadow
std
wasm

Structs§

AbstractGeneratorObject
AllCompartments
AllFrames
Capture all frames.
AllocPolicyBase
AllocationMetadataBuilder
AllocationMetadataBuilder__bindgen_vtable
ArenaAllocPolicyBase
ArrayBuffer
ArrayBufferOrView
ArrayBufferView
AtomicRefCounted
AutoAssertGCCallback
Assert that code is only ever called from a GC callback, disable the static rooting hazard analysis and assert if any allocation that could potentially trigger a GC occurs while this guard object is live.
AutoAssertNoContentJS
AutoAssertNoGC
Diagnostic assert (see MOZ_DIAGNOSTIC_ASSERT) that GC cannot occur while this class is live. This class does not disable the static rooting hazard analysis.
AutoBrittleMode
AutoCheckCannotGC
AutoClearTracingContext
AutoDebuggerJobQueueInterruption
[SMDOC] Protecting the debuggee’s job/microtask queue from debugger activity.
AutoDisableGenerationalGC
Ensure that generational GC is disabled within some scope.
AutoEnterCycleCollection
AutoEnterOOMUnsafeRegion
AutoEnterPolicy
AutoEnterPolicy__bindgen_vtable
AutoFilename
AutoGCRooter
AutoGeckoProfilerEntry
AutoHideScriptedCaller
AutoHoldPrincipals
AutoRequireNoGC
Pass a subclass of this “abstract” class to callees to require that they never GC. Subclasses can use assertions or the hazard analysis to ensure no GC happens.
AutoSaveExceptionState
Save and later restore the current exception state of a given JSContext. This is useful for implementing behavior in C++ that’s like try/catch or try/finally in JS.
AutoSetAsyncStackForNewCalls
Supply an alternative stack to incorporate into captured SavedFrame backtraces as the imputed caller of asynchronous JavaScript calls, like async function resumptions and DOM callbacks.
AutoStableStringChars
AutoSuppressGCAnalysis
AutoSuppressWarningReporter
A simple RAII class that clears the registered warning reporter on construction and restores it on destruction.
AutoTracingDetails
AutoTracingIndex
AutoWaivePolicy
BackgroundAllocPolicyBase
BackgroundSystemAllocPolicy
BarrierMethods
BaseProxyHandler
BaseProxyHandler__bindgen_vtable
BaseScript
BaseShape
BigInt
BigIntToNumberChecker
BufferContentsDeleter
UniquePtr deleter for external buffer contents.
BufferIterator
CallArgs
CallArgsBase
CallbackTracer
ClassExtension
ClassInfo
ClassSpec
ClippedTime
CloneDataPolicy
CodeSizes
Data for tracking JIT-code memory usage.
ColumnNumberOffset
ColumnNumberOneOrigin
ColumnNumberUnsignedOffset
Compartment
CompartmentFilter
CompartmentFilter__bindgen_vtable
CompartmentTransplantCallback
CompartmentTransplantCallback__bindgen_vtable
CompileOptions
Compilation options stored on the stack. An instance of this type simply holds references to dynamically allocated resources (element; filename; source map URL) that are owned by something else. If you create an instance of this type, it’s up to you to guarantee that everything you store in it will outlive it.
ConstLatin1Chars
ConstTwoByteChars
ConstUTF8CharsZ
ContextOptions
CrossCompartmentWrapper
CustomAutoRooter
Custom rooting behavior for internal and external clients.
CustomAutoRooter__bindgen_vtable
DataView
Debugger
DecodeOptions
DefineComparisonOps
DeletePolicy
Dispatchable
The Dispatchable interface allows the embedding to call SpiderMonkey on a JSContext thread when requested via DispatchToEventLoopCallback.
Dispatchable__bindgen_vtable
ElementAdder
EnvironmentChain
JS::EnvironmentChain stores a list of objects to put on the environment chain.
Error
Type representing a JS error or exception. At the moment this only “represents” an error in a rather abstract way.
ErrorReportBuilder
ExceptionStack
ExpandoAndGeneration
FirstSubsumedFrame
Capture the first frame with the given principals. By default, do not consider self-hosted frames with the given principals as satisfying the stack capture.
Flow
ForOfIterator
A convenience class for imitating a JS for-of loop. Typical usage:
ForwardingProxyHandler
FreePolicy
GCBufferStats
GCCellPtr
A GC pointer, tagged with the trace kind.
GCContext
GCDescription
GCPointerPolicy
GCPolicy
GCSizes
Data for tracking GC memory usage.
GeckoProfilerBaselineOSRMarker
GeckoProfilerEntryMarker
GeckoProfilerThread
GenericPrinter
GenericTracerImpl
GetterSetter
GlobalStats
Measurements that not associated with any individual runtime.
Handle
Reference to a T that has been rooted elsewhere. This is most useful as a parameter type, which guarantees that the T lvalue is properly rooted. See “Move GC Stack Rooting” above.
HandleObjectVector
HandleOperations
HandleValueArray
A generic handle to an array of rooted values.
HeapOperations
HelperThreadStats
IgnoreGCPolicy
IncludeUsedRval
InefficientNonFlatteningStringHashPolicy
This hash policy avoids flattening ropes (which perturbs the site being measured and requires a JSContext) at the expense of doing a FULL ROPE COPY on every hash and match! Beware.
InstantiateOptions
Subset of CompileOptions fields used while instantiating Stencils.
InstantiationStorage
IsBaseTraceType
IsHeapConstructibleType
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
JSDOMCallbacks
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
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.
JSONParseHandler
Handler with callbacks for JS::ParseJSONWithHandler.
JSONParseHandler__bindgen_vtable
JSONPrinter
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
JSTimers
Timing information for telemetry purposes
JSTracer
JSTracer__bindgen_vtable
JSTypedMethodJitInfo
JSWrapObjectCallbacks
JobQueue
Abstract base class for an ECMAScript Job Queue: https://www.ecma-international.org/ecma-262/9.0/index.html#sec-jobs-and-job-queues
JobQueue_SavedJobQueue
A saved job queue, represented however the JobQueue implementation pleases. Use AutoDebuggerJobQueueInterruption rather than trying to construct one of these directly; see documentation there.
JobQueue_SavedJobQueue__bindgen_vtable
JobQueue__bindgen_vtable
Latin1Chars
Latin1CharsZ
LimitedColumnNumberOneOrigin
LocaleString
MallocAllocPolicy
MapTypeToRootKind
MapTypeToTraceKind
MaxFrames
Capture at most this many frames.
MutableHandle
Similar to a handle, but the underlying storage can be changed. This is useful for outparams.
MutableHandleIdVector
MutableHandleObjectVector
MutableHandleOperations
MutableValueOperations
MutableWrappedPtrOperations
NoUsedRval
NonGCPointerPolicy
NotableClassInfo
Holds data about a notable class (one whose combined object and shape instances use more than a certain amount of memory) so we can report it individually.
NotableScriptSourceInfo
Holds data about a notable script source file (one whose combined script sources use more than a certain amount of memory) so we can report it individually.
NotableStringInfo
Holds data about a notable string (one which, counting all duplicates, uses more than a certain amount of memory) so we can report it individually.
NumberToBigIntConverter
Nursery
NurseryAllocableProxyHandler
OOM
Object
This layout is shared by all native objects. For non-native objects, the shape may always be accessed safely, and other members may be as well, depending on the object’s specific layout.
ObjectOpResult
Per ES6, the [[DefineOwnProperty]] internal method has three different possible outcomes:
ObjectOps
ObjectPrivateVisitor
ObjectPrivateVisitor__bindgen_vtable
OpaqueCrossCompartmentWrapper
OptimizedEncodingListener
The ConsumeStreamCallback is called from an active JSContext, passing a StreamConsumer that wishes to consume the given host object as a stream of bytes with the given MIME type. On failure, the embedding must report the appropriate error on ‘cx’. On success, the embedding must call consumer->consumeChunk() repeatedly on any thread until exactly one of:
OptimizedEncodingListener__bindgen_vtable
OwningCompileOptions
Compilation options, with dynamic lifetime. An instance of this type makes a copy of / holds / roots all dynamically allocated resources (principals; elements; strings) that it refers to. Its destructor frees / drops / unroots them. This is heavier than CompileOptions, below, but unlike CompileOptions, it can outlive any given stack frame.
OwningCompileOptions_ForFrontendContext
OwningDecodeOptions
PersistentRooted
A copyable, assignable global GC root type with arbitrary lifetime, an infallible constructor, and automatic unrooting on destruction.
PersistentRootedBase
PersistentRootedTraceableBase
PersistentRootedVector
PrefableCompileOptions
ProfilingCategoryPairInfo
ProfilingStack
PropMap
PropertyAttributes
PropertyDescriptor
A structure that represents a property on an object, or the absence of a property. Use {,Mutable}Handle to interact with instances of this structure rather than interacting directly with member fields.
PropertyKey
PropertyResult
ProxyDataLayout
ProxyOptions
ProxyReservedSlots
ProxyValueArray
PtrBarrierMethodsBase
RTPCallerTypeToken
ReadOnlyCompileOptions
The class representing a full set of compile options.
ReadOnlyDecodeOptions
Subset of CompileOptions fields used while decoding Stencils.
Realm
RealmBehaviors
RealmBehaviors specifies behaviors of a realm that can be changed after the realm’s been created.
RealmCreationOptions
RealmCreationOptions specifies options relevant to creating a new realm, that are either immutable characteristics of that realm or that are discarded after the realm has been created.
RealmOptions
RealmOptions specifies realm characteristics: both those that can’t be changed on a realm once it’s been created (RealmCreationOptions), and those that can be changed on an existing realm (RealmBehaviors).
RealmStats
RefCounted
RefPtr
RefPtr_ConstRemovingRefPtrTraits
RefPtr_Proxy
RegExpFlag
Regular expression flag values, suitable for initializing a collection of regular expression flags as defined below in |RegExpFlags|. Flags are listed in alphabetical order by syntax – /d, /g, /i, /m, /s, /u, /v, /y.
RegExpFlags
A collection of regular expression flags. Individual flag values may be combined into a collection using bitwise operators.
RegExpShared
RootedGCThingTraits
RootedOperations
RootedTraceableTraits
RootingContext
Runtime
RuntimeSizes
These measurements relate directly to the JSRuntime, and not to zones, compartments, and realms within it.
RuntimeStats
RuntimeStats__bindgen_vtable
SafelyInitialized
SafelyInitialized::create() creates a safely-initialized |T|, suitable for use as a default value in situations requiring a safe but arbitrary |T| value. Implemented as a static method of a struct to allow partial specialization for subclasses via the Enable template parameter.
SavedFrame
Scope
ScriptEnvironmentPreparer
PrepareScriptEnvironmentAndInvoke asserts the embedder has registered a ScriptEnvironmentPreparer and then it calls the preparer’s ‘invoke’ method with the given |closure|, with the assumption that the preparer will set up any state necessary to run script in |global|, invoke |closure| with a valid JSContext*, report any exceptions thrown from the closure, and return.
ScriptEnvironmentPreparer_Closure
ScriptEnvironmentPreparer_Closure__bindgen_vtable
ScriptEnvironmentPreparer__bindgen_vtable
ScriptSource
ScriptSourceInfo
This class holds information about the memory taken up by script sources from a particular file.
SecurityWrapper
SecurityWrapper__bindgen_vtable
ServoSizes
These are the measurements used by Servo.
Shape
ShapeInfo
SharedArrayRawBuffer
SharedArrayRawBufferRefs
SingleCompartment
SliceBudget
SourceText
StableCellHasher
StackRootedBase
StackRootedTraceableBase
StreamConsumer
StreamConsumer__bindgen_vtable
StringInfo
This class holds information about the memory taken up by identical copies of a particular string. Multiple JSStrings may have their sizes aggregated together into one StringInfo object. Note that two strings with identical chars will not be aggregated together if one is a short string and the other is not.
StructGCPolicy
Symbol
SystemAllocPolicy
TabSizes
TaggedColumnNumberOneOrigin
TempAllocPolicy
TenuredHeap
The TenuredHeap class is similar to the Heap class above in that it encapsulates the GC concerns of an on-heap reference to a JS object. However, it has two important differences:
TimeBudget
TraceOptions
TracingContext
TracingContext_Functor
TracingContext_Functor__bindgen_vtable
TranscodeSource
TransitiveCompileOptions
The common base class for the CompileOptions hierarchy.
TwoByteChars
TwoByteCharsZ
TypeIsGCThing
TypedArray_base
TypedRootedGCThingBase
TypedRootedTraceableBase
UTF8Chars
UTF8CharsZ
UniqueSelector
UnlimitedBudget
UnusedGCThingSizes
UnusedZero
Value
[SMDOC] JS::Value type
VirtualTraceable
VirtualTraceable__bindgen_vtable
WasmFunctionIndex
WasmModule
The WasmModule interface allows the embedding to hold a reference to the underying C++ implementation of a JS WebAssembly.Module object for purposes of efficient postMessage() and (de)serialization from a random thread.
WasmModule__bindgen_vtable
WeakMapTracer
WeakMapTracer__bindgen_vtable
WorkBudget
WrappedPtrOperations
Wrapper
WrapperOptions
Zone
ZoneStats
_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_rwlock_arch_t
__va_list_tag
_bindgen_ty_74
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§

AllocFunction
AsmJSOption
AutoGCRooterKind
AutoGCRooter_Kind
AutoSetAsyncStackForNewCalls_AsyncCallKind
BaseProxyHandler__bindgen_ty_1
CompartmentIterResult
An enum that JSIterateCompartmentCallback can return to indicate whether to keep iterating.
CompartmentSpecifier
Specification for which compartment/zone a newly created realm should use.
CompilationType
DOMProxyShadowsResult
DelazificationOption
Dispatchable_MaybeShuttingDown
ESClass
Enumeration describing possible values of the [[Class]] internal property value of objects.
ElementAdder_GetBehavior
ErrorArgumentsType
ErrorReportBuilder_SniffingBehavior
Error_ErrorKind
ExceptionStackBehavior
ExceptionStatus
ForOfIterator_NonIterableBehavior
FrontendOnly
GCNurseryProgress
Describes the progress of an observed nursery collection.
GCOptions
GCProgress
GCReason
Handle_CallerIdentity
Handle_Disambiguator
HeapState
InitState
IsArrayAnswer
The answer to a successful query as to whether an object is an Array per ES6’s internal |IsArray| operation (as exposed by |Array.isArray|).
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
MemoryUse
MimeType
ModuleErrorBehaviour
ModuleType
NewArrayBufferOutOfMemory
Marker enum to notify callers that the buffer contents must be freed manually when the ArrayBuffer allocation failed.
NukeReferencesFromTarget
NukeReferencesToWindow
ObjectOpResult_SpecialCodes
OnNewGlobalHookOption
During global creation, we fire notifications to callbacks registered via the Debugger API. These callbacks are arbitrary script, and can touch the global in arbitrary ways. When that happens, the global should not be in a half-baked state. But this creates a problem for consumers that need to set slots on the global to put it in a consistent state.
OwnTransferablePolicy
ProfilingCategory
ProfilingCategoryPair
PromiseRejectionHandlingState
PromiseState
PromiseUserInputEventHandlingState
PropertyAttribute
RootKind
RuntimeCode
SavedFrameResult
SavedFrameSelfHosted
ServoSizes_Kind
SmallestEncoding
SourceOwnership
StackFormat
StackKind
StructuredCloneScope
Indicates the “scope of validity” of serialized data.
SupportUnscopables
SymbolCode
TabSizes_Kind
TenuredHeap__bindgen_ty_1
ThreadType
TraceKind
TracerKind
TranscodeResult
TransferableOwnership
Values used to describe the ownership individual Transferables.
Type
ValueType
WeakEdgeTraceAction
WeakMapTraceAction
Wrapper_Flags

Constants§

BaseProxyHandler_CALL
BaseProxyHandler_ENUMERATE
BaseProxyHandler_GET
BaseProxyHandler_GET_PROPERTY_DESCRIPTOR
BaseProxyHandler_NONE
BaseProxyHandler_SET
ClassSpec_DontDefineConstructor
ClassSpec_ProtoKeyMask
ClassSpec_ProtoKeyWidth
ForOfIterator_NOT_ARRAY
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_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_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
LimitedColumnNumberOneOrigin_Limit
MaybeLimitedColumnNumber_OriginValue
NotableStringInfo_MAX_SAVED_CHARS
ProfilingStackFrame_NullPCOffset
PropertyKey_IntMax
PropertyKey_IntMin
PropertyKey_IntTagBit
PropertyKey_StringTypeTag
PropertyKey_SymbolTypeTag
PropertyKey_TypeMask
PropertyKey_VoidTypeTag
RegExpFlag_AllFlags
All regular expression flags.
RegExpFlag_DotAll
RegExpFlag_Global
Act globally and find all matches (rather than stopping after just the first one), i.e. /g.
RegExpFlag_HasIndices
Add .indices property to the match result, i.e. /d
RegExpFlag_IgnoreCase
Interpret regular expression source text case-insensitively by folding uppercase letters to lowercase, i.e. /i.
RegExpFlag_Multiline
Treat ^ and $ as begin and end of line, i.e. /m.
RegExpFlag_NoFlags
No regular expression flags.
RegExpFlag_Sticky
Only match starting from .lastIndex, i.e. /y.
RegExpFlag_Unicode
Use Unicode semantics, i.e. /u.
RegExpFlag_UnicodeSets
Use Unicode Sets semantics, i.e. /v.
SliceBudget_StepsPerExpensiveCheck
SliceBudget_UnlimitedCounter
TaggedColumnNumberOneOrigin_WasmFunctionTag
TempAllocPolicy_JsContextTag
TenuredHeap_flagsMask
TenuredHeap_maskBits
WasmFunctionIndex_DefaultBinarySourceColumnNumberOneOrigin
WasmFunctionIndex_Limit

Statics§

ArrayBuffer_FixedLengthSharedClass
ArrayBuffer_FixedLengthUnsharedClass
ArrayBuffer_GrowableSharedClass
ArrayBuffer_ResizableUnsharedClass
AutoEnterOOMUnsafeRegion_annotateOOMSizeCallback
CrossCompartmentWrapper_singleton
CrossCompartmentWrapper_singletonWithPrototype
DataView_FixedLengthClassPtr
DataView_ResizableClassPtr
FalseHandleValue
JS_NULL_CLASS_EXT
JS_NULL_CLASS_OPS
JS_NULL_CLASS_SPEC
JS_NULL_OBJECT_OPS
NullHandleValue
OpaqueCrossCompartmentWrapper_singleton
ProxyClass
ProxyClassExtension
ProxyClassOps
ProxyObjectOps
TracingContext_InvalidIndex
TrueHandleValue
TypedArray_Scalar
TypedArray_base_fixedLengthClasses
TypedArray_base_resizableClasses
UndefinedHandleValue
Wrapper_defaultProto
Wrapper_family
Wrapper_singleton
Wrapper_singletonWithPrototype

Functions§

AbortCollectingDelazifications
AbortCollectingDelazifications1
AbortIncrementalGC
If IsIncrementalGCInProgress(cx), this call aborts the ongoing collection and performs whatever work needs to be done to return the collector to its idle state. This may take an arbitrarily long time. When this function returns, IsIncrementalGCInProgress(cx) will always be false.
AddAssociatedMemory
Advise the GC of external memory owned by a JSObject. This is used to determine when to collect zones. Calls must be matched by calls to RemoveAssociatedMemory() when the memory is deallocated or no longer owned by the object.
AddGCNurseryCollectionCallback
Add and remove nursery collection callbacks for the given runtime. These will be called at the start and end of every nursery collection.
AddPersistentRoot
AddPersistentRoot1
AddPromiseReactions
Unforgeable, optimized version of the JS builtin Promise.prototype.then.
AddPromiseReactionsIgnoringUnhandledRejection
Unforgeable, optimized version of the JS builtin Promise.prototype.then.
AddRawValueRoot
AddServoSizeOf
AddSizeOfTab
AllowNewWrapper
AppendToEnvironmentChain
AreGCGrayBitsValid
ArrayBufferClone
Copy data from one array buffer to another.
ArrayBufferCopyData
Copy data from one array buffer to another.
ArrayBufferHasData
Return true if the ArrayBuffer |obj| contains any data, i.e. it is not a detached ArrayBuffer. (ArrayBuffer.prototype is not an ArrayBuffer.)
AssertHeapIsIdle
AssertJSStringBufferInCorrectArena
AssertObjectBelongsToCurrentThread
Asserts (in debug and release builds) that obj belongs to the current thread’s context.
AssertSameCompartment
AssertSameCompartment1
AtomToLinearString
AtomsZoneIsCollecting
BigIntFitsNumber
Same as BigIntFits(), but checks if the value fits inside a JS Number value.
BigIntFromBool
BigIntFromInt64
BigIntFromUint64
BigIntIsInt64
BigIntIsNegative
Return true if the given BigInt is negative.
BigIntIsUint64
BigIntToNumber
Convert the given BigInt to a Number value as if calling the Number constructor on it (https://tc39.es/ecma262/#sec-number-constructor-number-value). The value may be rounded if it doesn’t fit without loss of precision.
BigIntToString
Convert the given BigInt to a String value as if toString() were called on it.
BuildStackString
Given a SavedFrame JSObject stack, stringify it in the same format as Error.prototype.stack. The stringified stack out parameter is placed in the cx’s compartment. Defaults to the empty string.
Call
CallMethodIfWrapped
CallOriginalPromiseReject
Calls the current compartment’s original Promise.reject on the original Promise constructor, with resolutionValue passed as an argument.
CallOriginalPromiseResolve
Calls the current compartment’s original Promise.resolve on the original Promise constructor, with resolutionValue passed as an argument.
CallOriginalPromiseThen
Create a Promise with the given fulfill/reject handlers, that will be fulfilled/rejected with the value/reason that the promise promise is fulfilled/rejected with.
CaptureCurrentStack
Capture the current call stack as a chain of SavedFrame JSObjects, and set |stackp| to the SavedFrame for the youngest stack frame, or nullptr if there are no JS frames on the stack.
CheckCompileOptionsMatch
CheckRegExpSyntax
Check whether the given source is a valid regexp. If the regexp parses successfully, returns true and sets |error| to undefined. If the regexp has a syntax error, returns true, sets |error| to that error object, and clears the exception. Returns false on OOM or over-recursion.
CheckedUnwrapDynamic
CheckedUnwrapStatic
ClearKeptObjects
Clear kept alive objects in JS WeakRef. https://tc39.es/proposal-weakrefs/#sec-clear-kept-objects
ClearModuleEnvironment
ClearModulePrivate
Clear the private value associated with a source text module record.
ClearRegExpStatics
CollectGlobalStats
CollectRuntimeStats
CompartmentHasLiveGlobal
Compile
Compile the provided script using the given options. Return the script on success, or return null on failure (usually with an error reported).
Compile1
Compile the provided script using the given options. Return the script on success, or return null on failure (usually with an error reported).
CompileFunction
Compile a function with envChain plus the global as its scope chain. envChain must contain objects in the current compartment of cx. The actual scope chain used for the function will consist of With wrappers for those objects, followed by the current global of the compartment cx is in. This global must not be explicitly included in the scope chain.
CompileFunction1
Compile a function with envChain plus the global as its scope chain. envChain must contain objects in the current compartment of cx. The actual scope chain used for the function will consist of With wrappers for those objects, followed by the current global of the compartment cx is in. This global must not be explicitly included in the scope chain.
CompileFunctionUtf8
Identical to the CompileFunction overload above for UTF-8, but with Rust-friendly ergonomics.
CompileGlobalScriptToStencil
CompileGlobalScriptToStencil1
CompileJsonModule
Parse the given source buffer as a JSON module in the scope of the current global of cx and return a synthetic module record.
CompileJsonModule1
Parse the given source buffer as a JSON module in the scope of the current global of cx and return a synthetic module record. An error is reported if a UTF-8 encoding error is encountered.
CompileModule
Parse the given source buffer as a module in the scope of the current global of cx and return a source text module record.
CompileModule1
Parse the given source buffer as a module in the scope of the current global of cx and return a source text module record. An error is reported if a UTF-8 encoding error is encountered.
CompileModuleScriptToStencil
CompileModuleScriptToStencil1
CompileUtf8File
Compile the UTF-8 contents of the given file into a script. It is an error if the file contains invalid UTF-8. Return the script on success, or return null on failure (usually with an error reported).
CompileUtf8Path
Compile the UTF-8 contents of the file at the given path into a script. (The path itself is in the system encoding, not [necessarily] UTF-8.) It is an error if the file’s contents are invalid UTF-8. Return the script on success, or return null on failure (usually with an error reported).
ComputeThis
Construct
Invoke a constructor. This is the C++ equivalent of rval = Reflect.construct(fun, args, newTarget).
Construct1
Invoke a constructor. This is the C++ equivalent of rval = new fun(...args).
ContainsSharedArrayBuffer
Returns true if there are any live SharedArrayBuffer objects, including those for wasm memories, associated with the context. This is conservative, because it does not run GC. Some dead objects may not have been collected yet and thus will be thought live.
ContextOptionsRef
ConvertSavedFrameToPlainObject
Given a SavedFrame object, convert it and its transitive parents to plain objects. Because SavedFrame objects store their properties on the prototype, they cannot be usefully stringified to JSON. Assigning their properties to plain objects allow those objects to be stringified and the saved frame stack can be encoded as a string.
CopyArrayBuffer
Create a new ArrayBuffer, whose bytes are set to the values of the bytes in the provided ArrayBuffer.
CreateError
CreateMappedArrayBufferContents
Create memory mapped ArrayBuffer contents. Caller must take care of closing fd after calling this function.
CreateModuleRequest
CurrentGlobalOrNull
Get the current realm’s global. Returns nullptr if no realm has been entered.
CurrentThreadCanAccessRuntime
CurrentThreadCanAccessZone
DateGetMsecSinceEpoch
DateIsValid
Detect whether the internal date value is NaN.
DayFromTime
DayFromYear
DayWithinYear
DecodeStencil
DecodeStencil1
DefineFunctionWithReserved
DeflateStringToUTF8Buffer
DeleteEnvironmentChain
DeleteOwningCompileOptions
DeleteRealmOptions
DetachArrayBuffer
Detach an ArrayBuffer, causing all associated views to no longer refer to the ArrayBuffer’s original attached memory.
DisableJitBackend
DisableSpectreMitigationsAfterInit
DisableWasmHugeMemory
Attempt to disable Wasm’s usage of reserving a large virtual memory allocation to avoid bounds checking overhead. This must be called before any Wasm module or memory is created in this process, or else this function will fail.
EnableContextProfilingStack
EncodeNarrowToUtf8
Encode a narrow multibyte character string to a UTF-8 string.
EncodeUtf8ToNarrow
Encode a UTF-8 string to a narrow multibyte character string.
EncodeUtf8ToWide
Encode a UTF-8 string to a wide string.
EncodeWideToUtf8
Encode a wide string to a UTF-8 string.
EnqueueJob
Enqueue |job| on the internal job queue.
EnsureNonInlineArrayBufferOrView
EnterRealm
NB: This API is infallible; a nullptr return value does not indicate error.
Evaluate
Evaluate the given source buffer in the scope of the current global of cx, and return the completion value in |rval|.
Evaluate1
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.
Evaluate2
Evaluate the provided UTF-8 data in the scope of the current global of |cx|, and return the completion value in |rval|. If the data contains invalid UTF-8, an error is reported.
EvaluateUtf8Path
Evaluate the UTF-8 contents of the file at the given path, and return the completion value in |rval|. (The path itself is UTF-8 encoded, too.) If the contents contain any malformed UTF-8, an error is reported.
ExceptionStackOrNull
If the given object is an exception object (or an unwrappable cross-compartment wrapper for one), return the stack for that exception, if any. Will return null if the given object is not an exception object (including if it’s null or a security wrapper that can’t be unwrapped) or if the exception has no stack.
ExecuteInFrameScriptEnvironment
ExecuteRegExp
Execute a regexp on a given input, starting from |indexp|. Returns false on OOM or over-recursion.
ExecuteRegExpNoStatics
Execute a regexp on a given input, starting from |indexp|. This is the same as ExecuteRegExp, except it does not update the RegExp statics and can be called without a global object.
ExplainGCAbortReason
Get a statically allocated C string explaining the given Abort reason. Input is the integral value of the enum.
ExplainGCReason
Get a statically allocated C string explaining the given GC reason.
ExposeScriptToDebugger
FindSmallestEncoding
FinishCollectingDelazifications
FinishCollectingDelazifications1
FinishCollectingDelazifications2
FinishDynamicModuleImport
This must be called after a dynamic import operation is complete.
FinishIncrementalGC
If IsIncrementalGCInProgress(cx), this call finishes the ongoing collection by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(cx), this is equivalent to NonIncrementalGC. When this function returns, IsIncrementalGCInProgress(cx) will always be false.
ForceLexicalInitialization
Set all of the uninitialized lexicals on an object to undefined. Return true if any lexicals were initialized and false otherwise.
ForwardToNative
FromPropertyDescriptor
FunctionHasNativeReserved
GCThingTraceKind
GCTraceKindSize
Returns the base size in bytes of the GC thing of kind |kind|.
GCTraceKindToAscii
Returns a static string equivalent of |kind|.
GetAllocationMetadata
Get the metadata associated with an object.
GetAnyRealmInZone
GetArrayBufferByteLength
Return the available byte length of an ArrayBuffer.
GetArrayBufferData
Return a pointer to the start of the data referenced by a typed array. The data is still owned by the typed array, and should not be modified on another thread. Furthermore, the pointer can become invalid on GC (if the data is small and fits inside the array’s GC header), so callers must take care not to hold on across anything that could GC.
GetArrayBufferLengthAndData
GetArrayBufferMaybeSharedData
Return a pointer to the start of the array buffer’s data, and indicate whether the data is from a shared array buffer through an outparam.
GetArrayBufferMaybeSharedLengthAndData
Get the length, sharedness, and data from an ArrayBufferMaybeShared subtypes.
GetArrayBufferViewLengthAndData
GetArrayLength
Store |*lengthp = ToLength(obj.length)| and return true on success, else return false.
GetBuiltinClass
Determine the ECMAScript “class” – Date, String, RegExp, and all the other builtin object types (described in ECMAScript in terms of an objecting having “an [[ArrayBufferData]] internal slot” or similar language for other kinds of object – of the provided object.
GetCurrentRealmOrNull
GetDOMCallbacks
GetDebuggerObservesWasm
GetDeflatedUTF8StringLength
GetElementsWithAdder
GetErrorMessage
A JSErrorCallback suitable for passing to |JS_ReportErrorNumberASCII| and similar functions in concert with one of the |JSErrNum| error numbers.
GetErrorType
GetErrorTypeName
Get an error type name from a JSExnType constant. Returns nullptr for invalid arguments and JSEXN_INTERNALERR
GetExceptionCause
GetFirstArgumentAsTypeHint
If args.get(0) is one of the strings “string”, “number”, or “default”, set result to JSTYPE_STRING, JSTYPE_NUMBER, or JSTYPE_UNDEFINED accordingly and return true. Otherwise, return false with a TypeError pending.
GetFirstGlobalInCompartment
GetFirstSubsumedSavedFrame
Get the first SavedFrame object in this SavedFrame stack whose principals are subsumed by the given |principals|. If there is no such frame, return nullptr.
GetFunctionNativeReserved
Get or set function’s reserved slot value. fun should be a function created with *WithReserved API above. Such functions have 2 reserved slots, and which can be either 0 or 1.
GetFunctionRealm
GetGCHeapUsage
This function only reports GC heap memory, and not malloc allocated memory associated with GC things. It reports the total of all memory for the whole Runtime.
GetGCPhaseName
Get a statically allocated C string describing the Phase. Input is the integral value of the enum.
GetIsSecureContext
GetJSTimers
GetLinearStringCharAt
GetLinearStringLength
GetMemoryUsageForZone
This function reports memory used by a zone in bytes, this includes:
GetModuleDynamicImportHook
Get the HostImportModuleDynamically hook for the runtime.
GetModuleEnvironment
GetModuleForNamespace
GetModuleMetadataHook
Get the hook for populating the import.meta metadata object.
GetModuleNamespace
GetModuleObject
GetModuleRequestSpecifier
GetModuleRequestType
GetModuleResolveHook
Get the HostResolveImportedModule hook for the runtime.
GetModuleScript
GetNonCCWObjectGlobal
Get the global object associated with an object’s realm. The object must not be a cross-compartment wrapper (because CCWs are shared by all realms in the compartment).
GetNurseryCellZone
GetObjectAsArrayBuffer
Attempt to unwrap |obj| as an ArrayBuffer.
GetObjectProto
GetObjectRealmOrNull
GetObjectZone
GetObjectZoneFromAnyThread
GetPendingExceptionStack
GetProfilingCategoryPairInfo
GetPromiseAllocationSite
Returns a js::SavedFrame linked list of the stack that lead to the given Promise’s allocation.
GetPromiseConstructor
Returns the current compartment’s original Promise constructor.
GetPromiseID
Returns the given Promise’s process-unique ID.
GetPromiseIsHandled
Returns whether the given promise’s rejection is already handled or not.
GetPromisePrototype
Returns the current compartment’s original Promise.prototype.
GetPromiseResolutionSite
GetPromiseState
Returns the given Promise’s state as a JS::PromiseState enum value.
GetPromiseUserInputEventHandlingState
Returns the given Promise’s activation behavior state flag per above as a JS::PromiseUserInputEventHandlingState value. All promises are created with the DontCare state by default.
GetPropertyKeys
Add some or all property keys of obj to the id vector *props.
GetRealmArrayPrototype
GetRealmAsyncIteratorPrototype
GetRealmErrorPrototype
GetRealmFunctionPrototype
GetRealmFunctionPrototypeHandle
GetRealmGlobalOrNull
GetRealmIteratorPrototype
GetRealmKeyObject
GetRealmObjectPrototype
GetRealmObjectPrototypeHandle
GetRealmOriginalEval
GetRealmPrincipals
GetRealmPrivate
GetRealmZone
GetReduceMicrosecondTimePrecisionCallback
GetRegExpSource
Return the source text for a RegExp object (or a wrapper around one), or null on failure.
GetRequestedModuleSourcePos
GetRequestedModuleSpecifier
GetRequestedModuleType
GetRequestedModulesCount
GetSCOffset
GetSavedFrameAsyncCause
Given a SavedFrame JSObject, get its asyncCause string. Defaults to nullptr.
GetSavedFrameAsyncParent
Given a SavedFrame JSObject, get its asyncParent SavedFrame object or nullptr if there is no asyncParent. The asyncParentp out parameter is NOT guaranteed to be in the cx’s compartment. Defaults to nullptr.
GetSavedFrameColumn
Given a SavedFrame JSObject, get its column property. Defaults to 0.
GetSavedFrameFunctionDisplayName
Given a SavedFrame JSObject, get its functionDisplayName string, or nullptr if SpiderMonkey was unable to infer a name for the captured frame’s function. Defaults to nullptr.
GetSavedFrameLine
Given a SavedFrame JSObject, get its line property (1-origin). Defaults to 0.
GetSavedFrameParent
Given a SavedFrame JSObject, get its parent SavedFrame object or nullptr if it is the oldest frame in the stack. The parentp out parameter is NOT guaranteed to be in the cx’s compartment. Defaults to nullptr.
GetSavedFrameSource
Given a SavedFrame JSObject, get its source property. Defaults to the empty string.
GetSavedFrameSourceId
Given a SavedFrame JSObject, get an ID identifying its ScriptSource. Defaults to 0.
GetScriptedCallerGlobal
GetSelfHostedFunction
GetSharedArrayBufferByteLength
GetSharedArrayBufferData
GetSharedArrayBufferLengthAndData
GetSharedMemoryUsageForZone
GetStackFormat
GetStaticPrototype
GetSymbolCode
Return the SymbolCode telling what sort of symbol symbol is.
GetSymbolDescription
Get the [[Description]] attribute of the given symbol.
GetSymbolFor
Symbol.for as specified in ES6.
GetTenuredGCThingZone
GetTestingFunctions
GetWaitForAllPromise
Unforgeable version of the JS builtin Promise.all.
GetWarningReporter
GetWasmModule
GetWeakMapEntry
GetWellKnownSymbol
Get one of the well-known symbols defined by ES6. A single set of well-known symbols is shared by all compartments in a JSRuntime.
GetWellKnownSymbolKey
Get one of the well-known symbols defined by ES6 as PropertyKey. This is equivalent to calling JS::GetWellKnownSymbol and then creating a PropertyKey.
HasDefinedArrayBufferDetachKey
HeapBigIntWriteBarriers
HeapObjectPostWriteBarrier
HeapObjectWriteBarriers
HeapScriptWriteBarriers
HeapStringWriteBarriers
HeapValuePostWriteBarrier
HeapValueWriteBarriers
HideScriptedCaller
Informs the JS engine that the scripted caller should be hidden. This can be used by the embedding to maintain an override of the scripted caller in its calculations, by hiding the scripted caller in the JS engine and pushing data onto a separate stack, which it inspects when DescribeScriptedCaller returns null.
IdentifyStandardConstructor
IdentifyStandardInstance
IdentifyStandardInstanceOrPrototype
IdentifyStandardPrototype
IncrementalGCHasForegroundWork
Return whether an incremental GC has work to do on the foreground thread and would make progress if a slice was run now. If this returns false then the GC is waiting for background threads to finish their work and a slice started now would return immediately.
IncrementalGCSlice
Perform a slice of an ongoing incremental collection. When this function returns, the collection may not be complete. It must be called repeatedly until !IsIncrementalGCInProgress(cx).
IncrementalPreWriteBarrier
IncrementalPreWriteBarrier1
InformalValueTypeName
InitConsumeStreamCallback
InitDispatchsToEventLoop
InitMallocAllocator
InitRealmStandardClasses
InitSelfHostedCode
InitWithFailureDiagnostic
InstantiateGlobalStencil
InstantiateModuleStencil
InternalGCReason
Return true if the GC reason is internal to the JS engine.
IsArgumentsObject
IsArray
ES6 7.2.2.
IsArray1
Identical to IsArray above, but the nature of the object (if successfully determined) is communicated via |*answer|. In particular this method returns true and sets |*answer = IsArrayAnswer::RevokedProxy| when called on a revoked proxy.
IsArrayBufferObject
IsArrayBufferObjectMaybeShared
Check whether obj supports the JS::GetArrayBufferMaybeShared* APIs. Note that this may return false if a security wrapper is encountered that denies the unwrapping. If this test succeeds, then it is safe to call the various predicate and accessor JSAPI calls defined below.
IsArrayBufferViewShared
Return the isShared flag of a ArrayBufferView subtypes, which denotes whether the underlying buffer is a SharedArrayBuffer.
IsArrayObject
Determine whether |value| is an Array object or a wrapper around one. (An ES6 proxy whose target is an Array object, e.g. |var target = [], handler = {}; Proxy.revocable(target, handler).proxy|, is not considered to be an Array.)
IsArrayObject1
Determine whether |obj| is an Array object or a wrapper around one. (An ES6 proxy whose target is an Array object, e.g. |var target = [], handler = {}; Proxy.revocable(target, handler).proxy|, is not considered to be an Array.)
IsAsyncStackCaptureEnabledForRealm
Returns true if capturing stack trace data to associate with an asynchronous operation is currently enabled for the current context realm.
IsAtomsZone
IsCallable
Return true if the given object is callable. In ES6 terms, an object is callable if it has a [Call] internal method.
IsCompartmentZoneSweepingOrCompacting
IsConstructor
Return true if the given object is a constructor. In ES6 terms, an object is a constructor if it has a [Construct] internal method. The expression new obj() throws a TypeError if obj is not a constructor.
IsCyclicModule
Checks if the given module is a cyclic module.
IsDetachedArrayBufferObject
Check whether the obj is a detached ArrayBufferObject. Note that this may return false if a security wrapper is encountered that denies the unwrapping.
IsFunctionObject
IsGCPoisoning
Whether we are poisoning unused/released data for error detection. Governed by the JS_GC_ALLOW_EXTRA_POISONING #ifdef as well as the javascript.options.extra_gc_poisoning pref.
IsGCScheduled
Returns true if any zone in the system has been scheduled for GC with one of the functions above or by the JS engine.
IsGenerationalGCEnabled
Returns true if generational allocation and collection is currently enabled on the given runtime.
IsISOStyleDate
IsIncrementalBarrierNeeded
IsIncrementalGCEnabled
Returns true if incremental GC is enabled. Simply having incremental GC enabled is not sufficient to ensure incremental collections are happening. See the comment “Incremental GC” above for reasons why incremental GC may be suppressed. Inspection of the “nonincremental reason” field of the GCDescription returned by GCSliceCallback may help narrow down the cause if collections are not happening incrementally when expected.
IsIncrementalGCInProgress
Returns true while an incremental GC is ongoing, both when actively collecting and between slices.
IsIncrementalGCInProgress1
Returns true while an incremental GC is ongoing, both when actively collecting and between slices.
IsLargeArrayBufferMaybeShared
Returns whether the passed array buffer is ‘large’: its byteLength >= 2 GB.
IsLargeArrayBufferView
IsMapObject
On success, returns true, setting |*isMap| to true if |obj| is a Map object or a wrapper around one, or to false if not. Returns false on failure.
IsMappedArrayBufferObject
Check whether the obj is ArrayBufferObject and memory mapped. Note that this may return false if a security wrapper is encountered that denies the unwrapping.
IsMaybeWrappedSavedFrame
Return true iff the given object is either a SavedFrame object or wrapper around a SavedFrame object, and it is not the SavedFrame.prototype object.
IsObjectInContextCompartment
IsProfileTimelineRecordingEnabled
IsPromiseObject
Returns true if the given object is an unwrapped PromiseObject, false otherwise.
IsResizableArrayBufferMaybeShared
Returns whether the passed array buffer is resizable or growable for shared array buffers.
IsResizableArrayBufferView
IsSavedFrame
IsSetObject
On success, returns true, setting |*isSet| to true if |obj| is a Set object or a wrapper around one, or to false if not. Returns false on failure.
IsSharableCompartment
IsSharedArrayBufferObject
Check whether obj supports the JS::GetSharedArrayBuffer* APIs. Note that this may return false if a security wrapper is encountered that denies the unwrapping. If this test succeeds, then it is safe to call the various accessor JSAPI calls defined below.
IsStencilCacheable
IsSystemCompartment
IsSystemRealm
IsSystemZone
IsUnwrappedSavedFrame
Return true iff the given object is a SavedFrame object and not the SavedFrame.prototype object.
IsValidJSON
Returns true if the given text is valid JSON.
IsValidJSON1
IsWasmModuleObject
IsWeakMapObject
IsWindowProxy
Returns true iff obj has the WindowProxy Class (see SetWindowProxyClass).
IsWindowSlow
IterateGrayObjects
Invoke cellCallback on every gray JSObject in the given zone.
IterateRealms
This function calls |realmCallback| on every realm. Beware that there is no guarantee that the realm will survive after the callback returns. Also, barriers are disabled via the TraceSession.
IterateRealmsInCompartment
Like IterateRealms, but only iterates realms in |compartment|.
IterateRealmsWithPrincipals
Like IterateRealms, but only call the callback for realms using |principals|.
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_AsShadowZone
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_CallArgsFromVp
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_CloneObject
JS_CompareStrings
JS_ConcatStrings
Concatenate two strings, possibly resulting in a rope. See above for thread safety comments.
JS_CopyOwnPropertiesAndPrivateFields
Copies all own properties and private fields from |obj| to |target|. Both |obj| and |target| must not be cross-compartment wrappers because we have to enter their realms.
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 return the address of that struct. Otherwise, it returns nullptr. The lifetime of the error report struct that might be returned is the same as the lifetime of the exception object.
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_ForOfIteratorInit
JS_ForOfIteratorNext
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_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_GetOwnPropertyDescriptor
JS_GetOwnPropertyDescriptorById
JS_GetOwnUCPropertyDescriptor
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_GetPropertyDescriptor
JS_GetPropertyDescriptorById
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_GetUCPropertyDescriptor
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_Init
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_NewOwningCompileOptions
JS_NewPlainObject
Creates a new plain object, like new Object(), with Object.prototype as [[Prototype]].
JS_NewRealmOptions
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_SetGrayGCRootsTracer
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_SetObjectsTenuredCallback
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_StackCapture_AllFrames
JS_StackCapture_FirstSubsumedFrame
JS_StackCapture_MaxFrames
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_TraceObjectGroupCycleCollectorChildren
JS_TraceShapeCycleCollectorChildren
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_ValueIsBoolean
JS_ValueIsDouble
JS_ValueIsInt32
JS_ValueIsNull
JS_ValueIsNumber
JS_ValueIsUndefined
JS_ValueSetBoolean
JS_ValueSetDouble
JS_ValueSetInt32
JS_ValueSetNull
JS_ValueToBoolean
JS_ValueToConstructor
JS_ValueToDouble
JS_ValueToFunction
JS_ValueToId
JS_ValueToInt32
JS_ValueToNumber
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_WriteUint32Pair
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
JobQueueIsEmpty
Inform the runtime that the job queue is empty and the embedding is going to execute its last promise job. The runtime may now choose to skip creating promise jobs for asynchronous execution and instead continue execution synchronously. More specifically, this optimization is used to skip the standard job queuing behavior for await operations in async functions.
JobQueueMayNotBeEmpty
Inform the runtime that job queue is no longer empty. The runtime can now no longer skip creating promise jobs for asynchronous execution, because pending jobs in the job queue must be executed first to preserve the FIFO (first in - first out) property of the queue. This effectively undoes JobQueueIsEmpty and re-enables the standard job queuing behavior.
LeaveRealm
LooselyEqual
Store |v1 == v2| to |*equal| – loose equality, which may perform user-modifiable conversions on |v1| or |v2|.
LossyTwoByteCharsToNewLatin1CharsZ
LossyUTF8CharsToNewTwoByteCharsZ
MakeDate
MakeDate1
MapClear
MapDelete
MapEntries
MapForEach
MapGet
MapHas
MapKeys
MapSet
MapSize
MapValues
MaybeFreezeCtorAndPrototype
MaybeGetScriptPrivate
Get the script private value associated with an object, if any.
MaybeRunNurseryCollection
Check whether the nursery should be eagerly collected as per WantEagerMajorGC above, and if so run a collection.
MemoryReportingSundriesThreshold
In memory reporting, we have concept of “sundries”, line items which are too small to be worth reporting individually. Under some circumstances, a memory reporter gets tossed into the sundries bucket if it’s smaller than MemoryReportingSundriesThreshold() bytes.
MinorGcToJSON
ModuleEvaluate
ModuleIsLinked
ModuleLink
MonthFromTime
NewArrayBuffer
Create a new ArrayBuffer with the given byte length.
NewArrayBufferWithContents
NewArrayBufferWithUserOwnedContents
Create a new ArrayBuffer with the given non-null |contents|.
NewArrayObject
Create an Array from the current realm with the given contents.
NewArrayObject1
Create an Array from the current realm with the given length and allocate memory for all its elements. (The elements nonetheless will not exist as properties on the returned array until values have been assigned to them.)
NewDateObject
NewDateObject1
Create a new Date object for a year/month/day-of-month/hour/minute/second.
NewEnvironmentChain
NewExternalArrayBuffer
Create a new ArrayBuffer with the given contents. The contents must not be modified by any other code, internal or external.
NewFunctionByIdWithReserved
NewFunctionByIdWithReservedAndProto
NewFunctionFromSpec
Create a new function based on the given JSFunctionSpec, *fs. id is the result of a successful call to PropertySpecNameToId(cx, fs->name, &id) or PropertySpecNameToPermanentId(cx, fs->name, &id).
NewFunctionFromSpec1
Same as above, but without an id arg, for callers who don’t have the id already.
NewFunctionWithReserved
NewMapObject
NewMappedArrayBufferWithContents
Create a new mapped ArrayBuffer with the given memory mapped contents. It must be legal to free the contents pointer by unmapping it. On success, ownership is transferred to the new mapped ArrayBuffer.
NewPromiseObject
Returns a new instance of the Promise builtin class in the current compartment, with the right slot layout.
NewProxyObject
NewRegExpObject
Create a new RegExp for the given Latin-1-encoded bytes and flags.
NewSetObject
NewSharedArrayBuffer
Create a new SharedArrayBuffer with the given byte length. This may only be called if JS::RealmCreationOptionsRef(cx).getSharedMemoryAndAtomicsEnabled() is true.
NewStringFromKnownLiveLatin1Buffer
Like NewStringFromLatin1Buffer, but can be used to avoid refcounting overhead in cases where the returned string doesn’t use the buffer. The caller must ensure the buffer outlives this call.
NewStringFromKnownLiveTwoByteBuffer
Similar to NewStringFromKnownLiveLatin1Buffer but for char16_t buffers.
NewStringFromKnownLiveUTF8Buffer
Like NewStringFromUTF8Buffer, but can be used to avoid refcounting overhead in cases where the returned string doesn’t use the buffer. The caller must ensure the buffer outlives this call.
NewStringFromLatin1Buffer
Create a new JSString possibly backed by |buffer|. The contents of |buffer| will be interpreted as an array of Latin1 characters.
NewStringFromTwoByteBuffer
Similar to NewStringFromLatin1Buffer but for char16_t buffers.
NewStringFromUTF8Buffer
Similar to NewStringFromLatin1Buffer but for UTF8 buffers.
NewSymbol
Create a new Symbol with the given description. This function never returns a Symbol that is in the Runtime-wide symbol registry.
NewUCRegExpObject
Create a new RegExp for the given source and flags.
NewWeakMapObject
NonIncrementalGC
Performs a non-incremental collection of all selected zones.
NoteIntentionalCrash
Hint that we expect a crash. Currently, the only thing that cares is the breakpad injector, which (if loaded) will suppress minidump generation.
NotifyAnimationActivity
NotifyGCRootsRemoved
NukeCrossCompartmentWrapper
NukeCrossCompartmentWrapperIfExists
NukeCrossCompartmentWrappers
NukeNonCCWProxy
NukeRemovedCrossCompartmentWrapper
NukedObjectRealm
NumberToBigInt
Create a BigInt from a floating-point value. If the number isn’t integral (that is, if it’s NaN, an infinity, or contains a fractional component), this function returns null and throws an exception.
NumberToString
Store in |out| the null-terminated, base-10 result of |ToString| applied to |d| per https://tc39.es/ecma262/#sec-tostring-applied-to-the-number-type. (This will produce “NaN”, “-Infinity”, or “Infinity” for non-finite |d|.)
ObjectIsDate
On success, returns true, setting |*isDate| to true if |obj| is a Date object or a wrapper around one, or to false if not. Returns false on failure.
ObjectIsRegExp
On success, returns true, setting |*isRegExp| to true if |obj| is a RegExp object or a wrapper around one, or to false if not. Returns false on failure.
OrdinaryHasInstance
OrdinaryToPrimitive
ES6 draft 20141224, 7.1.1, second algorithm.
ParseJSONWithHandler
Performs the JSON.parse operation as specified by ECMAScript, and call callbacks defined by the handler.
ParseJSONWithHandler1
PeakSizeOfTemporary
PinArrayBufferOrViewLength
PrepareForFullGC
Schedule all zones to be collected in the next GC.
PrepareForIncrementalGC
When performing an incremental GC, the zones that were selected for the previous incremental slice must be selected in subsequent slices as well. This function selects those slices automatically.
PrepareScriptEnvironmentAndInvoke
PrepareZoneForGC
Schedule the given zone to be collected as part of the next GC.
PrintError
PrintError1
PropertySpecNameEqualsId
PropertySpecNameToPermanentId
Create a jsid that does not need to be marked for GC.
ProtoKeyToClass
ProtoKeyToId
RealmBehaviorsRef
RealmBehaviorsRef1
RealmCreationOptionsRef
RealmCreationOptionsRef1
RecomputeWrappers
RegisterContextProfilingEventMarker
RejectPromise
Rejects the given promise with the given rejectionValue.
ReleaseMappedArrayBufferContents
Release the allocated resource of mapped ArrayBuffer contents before the object is created. If a new object has been created by JS::NewMappedArrayBufferWithContents() with this content, then JS::DetachArrayBuffer() should be used instead to release the resource used by the object.
RemapAllWrappersForObject
RemapDeadWrapper
RemapRemoteWindowProxies
RemapWrapper
RemoveAssociatedMemory
Advise the GC that external memory reported by JS::AddAssociatedMemory() is no longer owned by a JSObject. Calls must match those to AddAssociatedMemory().
RemoveGCNurseryCollectionCallback
RemoveRawValueRoot
RenewProxyObject
ReportAccessDenied
ReportBadValueTypeAndCrash
ReportIsNotFunction
ReportLargeOutOfMemory
ReportOutOfMemory
ReportOutOfMemory1
ReportSourceTooLong
ReportSourceTooLong1
ReportUncatchableException
An uncatchable exception is used to terminate execution by returning false or nullptr without reporting a pending exception on the context. These exceptions are called “uncatchable” because try-catch can’t be used to catch them.
ResetRealmMathRandomSeed
Reset the seed for Math.random() within the current realm.
ResetTimeZone
Re-query the system to determine the current time zone adjustment from UTC, including any component due to DST. If the time zone has changed, this will cause all Date object non-UTC methods and formatting functions to produce appropriately adjusted results.
ResolvePromise
Resolves the given Promise with the given resolutionValue.
RestartDrainingJobQueue
Instruct the runtime to restart draining the internal job queue after stopping it with StopDrainingJobQueue.
RunJobs
RunNurseryCollection
RuntimeHeapState
SameValue
Stores |SameValue(v1, v2)| to |*equal| – using the SameValue operation defined in ECMAScript, initially exposed to script as |Object.is|. SameValue behaves identically to strict equality, except that it equates two NaN values and does not equate differently-signed zeroes. It performs no conversions on |v1| or |v2| before comparing.
SetAVXEnabled
SetAdd
SetAllocationMetadataBuilder
Specify a callback to invoke when creating each JS object in the current compartment, which may return a metadata object to associate with the object.
SetAnyPromiseIsHandled
SetArrayLength
Perform |obj.length = length| as if in strict mode code, with a fast path for the case where |obj| is an Array.
SetBrittleMode
Transition the cx to a mode where failures that would normally cause a false return value will instead crash with a diagnostic assertion.
SetClear
SetContextProfilingStack
SetCreateGCSliceBudgetCallback
Called when generating a GC slice budget. It allows the embedding to control the duration of slices and potentially check an interrupt flag as well. For internally triggered GCs, the given millis parameter is the JS engine’s internal scheduling decision, which the embedding can choose to ignore. (Otherwise, it will be the value that was passed to eg JS::IncrementalGCSlice()).
SetDOMCallbacks
SetDOMProxyInformation
SetDelete
SetDestroyRealmCallback
SetDoCycleCollectionCallback
The purge gray callback is called after any COMPARTMENT_REVIVED GC in which the majority of compartments have been marked gray.
SetEntries
SetFilenameValidationCallback
SetForEach
SetFunctionNativeReserved
SetGCSliceCallback
The GC slice callback is called at the beginning and end of each slice. This callback may be used for GC notifications as well as to perform additional marking.
SetHas
SetHostCleanupFinalizationRegistryCallback
SetHostEnsureCanAddPrivateElementHook
SetJobQueue
Tell SpiderMonkey to use queue to schedule promise reactions.
SetKeys
SetLowMemoryState
SetModuleDynamicImportHook
Set the HostImportModuleDynamically hook for the runtime to the given function.
SetModuleMetadataHook
Set the hook for populating the import.meta metadata object to the given function.
SetModulePrivate
Set a private value associated with a source text module record.
SetModuleResolveHook
Set the HostResolveImportedModule hook for the runtime to the given function.
SetOutOfMemoryCallback
SetPendingExceptionStack
SetPreserveWrapperCallbacks
SetProcessBuildIdOp
Embedder hook to set the buildId-generating function.
SetProcessLargeAllocationFailureCallback
SetProfileTimelineRecordingEnabled
Tell JS engine whether Profile Timeline Recording is enabled or not. If Profile Timeline Recording is enabled, data shown there like stack won’t be optimized out. This is global state and not associated with specific runtime or context.
SetProfilingThreadCallbacks
SetPromiseRejectionTrackerCallback
Sets the callback that’s invoked whenever a Promise is rejected without a rejection handler, and when a Promise that was previously rejected without a handler gets a handler attached.
SetPromiseUserInputEventHandlingState
Sets the given Promise’s activation behavior state flag per above as a JS::PromiseUserInputEventHandlingState value.
SetPropertyIgnoringNamedGetter
SetRealmNameCallback
SetRealmNonLive
SetRealmPrincipals
SetRealmPrivate
SetRealmReduceTimerPrecisionCallerType
SetReduceMicrosecondTimePrecisionCallback
SetRegExpInput
SetReservedSlotWithBarrier
SetScriptEnvironmentPreparer
SetScriptPrivate
Set a private value associated with a script. Note that this value is shared by all nested scripts compiled from a single source file.
SetScriptPrivateReferenceHooks
Set the script private finalize hook for the runtime to the given function.
SetSettledPromiseIsHandled
SetSize
SetStackFormat
SetTimeResolutionUsec
SetValueInProxy
SetValues
SetWaitCallback
SetWarningReporter
SetWeakMapEntry
SetWindowProxy
Associates a WindowProxy with a Window (global object). windowProxy must have the Class set by SetWindowProxyClass.
SetWindowProxyClass
Tell the JS engine which Class is used for WindowProxy objects. Used by the functions below.
ShouldIgnorePropertyDefinition
ShutDownMallocAllocator
ShutdownAsyncTasks
When a JSRuntime is destroyed it implicitly cancels all async tasks in progress, releasing any roots held by the task. However, this is not soon enough for cycle collection, which needs to have roots dropped earlier so that the cycle collector can transitively remove roots for a future GC. For these and other cases, the set of pending async tasks can be canceled with this call earlier than JSRuntime destruction.
SimpleStringToBigInt
Create a BigInt by parsing a string consisting of an optional sign character followed by one or more alphanumeric ASCII digits in the provided radix.
SizeOfStencil
SkipZoneForGC
Undoes the effect of the Prepare methods above. The given zone will not be collected in the next GC.
StartCollectingDelazifications
StartCollectingDelazifications1
StartIncrementalGC
Begin an incremental collection and perform one slice worth of work. When this function returns, the collection may not be complete. IncrementalGCSlice() must be called repeatedly until !IsIncrementalGCInProgress(cx).
StealArrayBufferContents
Steal the contents of the given ArrayBuffer. The ArrayBuffer has its length set to 0 and its contents array cleared. The caller takes ownership of the return value and must free it or transfer ownership via JS::NewArrayBufferWithContents when done using it.
StealPendingExceptionStack
StencilAddRef
StencilIsBorrowed
StencilRelease
StopDrainingJobQueue
Instruct the runtime to stop draining the internal job queue.
StrictlyEqual
Store |v1 === v2| to |*equal| – strict equality, which performs no conversions on |v1| or |v2| before comparing.
StringIsASCII
StringIsASCII1
StringIsArrayIndex
Determine whether the given string is an array index in the sense of https://tc39.github.io/ecma262/#array-index.
StringIsArrayIndex1
Overload of StringIsArrayIndex taking a (char16_t*,length) pair. Behaves the same as the JSLinearString version.
StringToBigInt
Create a BigInt by parsing a string using the ECMAScript StringToBigInt algorithm (https://tc39.es/ecma262/#sec-stringtobigint). Latin1 and two-byte character ranges are supported. It may be convenient to use JS::ConstLatin1Chars or JS::ConstTwoByteChars.
StringToBigInt1
StringToLinearStringSlow
SystemCompartmentCount
SystemRealmCount
ThrowOnModuleEvaluationFailure
ToBigInt
Convert a JS::Value to a BigInt using the ECMAScript ToBigInt algorithm (https://tc39.es/ecma262/#sec-tobigint).
ToBigInt64
Convert the given BigInt, modulo 2**64, to a signed 64-bit integer.
ToBigUint64
Convert the given BigInt, modulo 2**64, to an unsigned 64-bit integer.
ToBooleanSlow
ToCompletePropertyDescriptor
ToGetterId
Generate getter/setter id for given id, by adding “get “ or “set “ prefix.
ToInt8Slow
ToInt16Slow
ToInt32Slow
ToInt64Slow
ToJSON
Performs the JSON.stringify operation, as specified by ECMAScript, except writing stringified data by one call of |callback|, passing |data| as argument.
ToJSONMaybeSafely
An API akin to JS_Stringify but with the goal of not having observable side-effects when the stringification is performed. This means it does not allow a replacer or a custom space and has the following constraints on its input:
ToNumberSlow
ToObjectSlow
ToPrimitive
Convert obj to a primitive value. On success, store the result in vp and return true.
ToSetterId
ToStringSlow
ToUint8Slow
ToUint16Slow
ToUint32Slow
ToUint64Slow
ToWindowIfWindowProxy
If obj is a WindowProxy, get its associated Window (the compartment’s global), else return obj. This function is infallible and never returns nullptr.
ToWindowProxyIfWindowSlow
TraceChildren
TraceGrayWrapperTargets
TraceRoot
TraceRoot1
TraceRoot2
TraceRoot3
TraceRoot4
TraceRoot5
TraceRoot6
TraceRoot7
TraceRoot8
TraceRoot9
TraceRoot10
TraceRoot11
TraceRoot12
TraceValueArray
TraceWeakMaps
TransparentObjectWrapper
UTF8CharsToNewLatin1CharsZ
UTF8CharsToNewTwoByteCharsZ
Unbox
UncheckedUnwrap
UncheckedUnwrapWithoutExpose
UnhideScriptedCaller
UninlinedIsCrossCompartmentWrapper
UnmarkGrayGCThingRecursively
Unsets the gray bit for anything reachable from |thing|. |kind| should not be JS::TraceKind::Shape. |thing| should be non-null. The return value indicates if anything was unmarked.
UnsafeTraceManuallyBarrieredEdge
UnwrapArrayBuffer
UnwrapArrayBufferMaybeShared
UnwrapArrayBufferView
UnwrapBigInt64Array
UnwrapBigUint64Array
UnwrapFloat16Array
UnwrapFloat32Array
UnwrapFloat64Array
UnwrapInt8Array
UnwrapInt16Array
UnwrapInt32Array
UnwrapOneCheckedDynamic
UnwrapOneCheckedStatic
UnwrapSharedArrayBuffer
UnwrapUint8Array
UnwrapUint8ClampedArray
UnwrapUint16Array
UnwrapUint32Array
UpdateDebugMetadata
UseInternalJobQueues
Use the runtime’s internal handling of job queues for Promise jobs.
UserCompartmentCount
UserRealmCount
Utf8ToOneUcs4Char
WantEagerMajorGC
WantEagerMinorGC
Check whether the nursery should be eagerly collected, this is before it is full.
WarnASCII
Report a warning represented by the sprintf-like conversion of ASCII format filled from trailing ASCII arguments.
WarnLatin1
Report a warning represented by the sprintf-like conversion of Latin-1 format filled from trailing Latin-1 arguments.
WarnUTF8
Report a warning represented by the sprintf-like conversion of UTF-8 format filled from trailing UTF-8 arguments.
WasIncrementalGC
Returns true if the most recent GC ran incrementally.
YearFromTime
ZoneGlobalsAreAllGray

Type Aliases§

AfterWaitCallback
ArrayBufferOrView_DataType
AutoEnterOOMUnsafeRegion_AnnotateOOMAllocationSizeCallback
AutoEnterPolicy_Action
AutoRooterListHeads
EnumeratedArray is a fixed-size array container for use when an array is indexed by a specific enum class.
BaseProxyHandler_Action
BeforeWaitCallback
BigInt64Array
BigUint64Array
BufferContentsFreeFunc
BuildIdCharVector
Vector of characters used for holding build ids.
BuildIdOp
Return the buildId (represented as a sequence of characters) associated with the currently-executing build. If the JS engine is embedded such that a single cache entry can be observed by different compiled versions of the JS engine, it is critical that the buildId shall change for each new build of the JS engine.
CanTransferStructuredCloneOp
Called when the transferring objects are checked. If this function returns false, the serialization ends throwing a DataCloneError exception.
ClassObjectCreationOp
Callback for the creation of constructor and prototype objects.
ColumnNumberOneOrigin_Base
ConstCharPtr
ConstLatin1Chars_Base
ConstLatin1Chars_CharT
ConstTwoByteChars_Base
ConstTwoByteChars_CharT
ConstUTF8CharsZ_CharT
ConsumeStreamCallback
CreateSliceBudgetCallback
CrossCompartmentSecurityWrapper
DOMCallbacks
DOMInstanceClassHasProtoAtDepth
DOMInstanceClassIsError
DOMProxyShadowsCheck
DefaultHasher
DefinePropertyOp
DelayedDispatchToEventLoopCallback
DeletePropertyOp
DestroyRealmCallback
DispatchToEventLoopCallback
Callbacks to dispatch a JS::Dispatchable to a JSContext’s thread’s event loop.
DoCycleCollectionCallback
EnableIfABOVType
EnsureCanAddPrivateElementOp
Install an context wide callback that implements the ECMA262 specification host hook HostEnsureCanAddPrivateElement.
ExternalTypeOf_t
FILE
FilenameValidationCallback
Install a process-wide callback to validate script filenames. The JS engine will invoke this callback for each JS script it parses or XDR decodes.
FinishClassInitOp
Callback for custom post-processing after class initialization via ClassSpec.
Float16Array
Float32Array
Float64Array
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.)
FrontendContext
GCNurseryCollectionCallback
A nursery collection callback receives the progress of the nursery collection and the reason for the collection.
GCSliceCallback
GCVector_ElementType
GetElementsOp
GetOwnPropertyOp
GetPropertyOp
HandleBigInt
HandleFunction
Reference to a T that has been rooted elsewhere. This is most useful as a parameter type, which guarantees that the T lvalue is properly rooted. See “Move GC Stack Rooting” above.
HandleId
Reference to a T that has been rooted elsewhere. This is most useful as a parameter type, which guarantees that the T lvalue is properly rooted. See “Move GC Stack Rooting” above.
HandleIdVector
HandleObject
Reference to a T that has been rooted elsewhere. This is most useful as a parameter type, which guarantees that the T lvalue is properly rooted. See “Move GC Stack Rooting” above.
HandleScript
HandleString
Reference to a T that has been rooted elsewhere. This is most useful as a parameter type, which guarantees that the T lvalue is properly rooted. See “Move GC Stack Rooting” above.
HandleSymbol
HandleValue
Reference to a T that has been rooted elsewhere. This is most useful as a parameter type, which guarantees that the T lvalue is properly rooted. See “Move GC Stack Rooting” above.
HandleValueVector
Handle_ElementType
HasPropertyOp
HasReleasedWrapperCallback
HashMap
HashNumber
HashSet
Heap
Heap_ElementType
IdVector
InefficientNonFlatteningStringHashPolicy_Lookup
Int8Array
Int16Array
Int32Array
Int64Limits
IsAcceptableThis
IterateGCThingCallback
IterateRealmCallback
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
UniquePtr is a smart pointer that wholly owns a resource. Ownership may be transferred out of a UniquePtr through explicit action, but otherwise the resource is destroyed when the UniquePtr is destroyed.
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
JSGrayRootsTracer
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
JSObjectsTenuredCallback
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
LargeAllocationFailureCallback
If a large allocation fails when calling pod_{calloc,realloc}CanGC, the JS engine may call the large-allocation-failure callback, if set, to allow the embedding to flush caches, possibly perform shrinking GCs, etc. to make some room. The allocation will then be retried (and may still fail.) This callback can be called on any thread and must be set at most once in a process.
Latin1Char
Latin1CharsZ_Base
Latin1CharsZ_CharT
Latin1Chars_Base
Latin1Chars_CharT
LimitedColumnNumberOneOrigin_Base
LookupPropertyOp
MallocSizeOf
ModuleDynamicImportHook
The HostImportModuleDynamically hook.
ModuleMetadataHook
The module metadata hook.
ModuleResolveHook
The HostResolveImportedModule hook.
MozExternalRefCountType
MozRefCountType
MozRefCountType is Mozilla’s reference count type.
MutableHandleBigInt
MutableHandleFunction
Similar to a handle, but the underlying storage can be changed. This is useful for outparams.
MutableHandleId
Similar to a handle, but the underlying storage can be changed. This is useful for outparams.
MutableHandleObject
Similar to a handle, but the underlying storage can be changed. This is useful for outparams.
MutableHandleScript
MutableHandleString
Similar to a handle, but the underlying storage can be changed. This is useful for outparams.
MutableHandleSymbol
MutableHandleValue
Similar to a handle, but the underlying storage can be changed. This is useful for outparams.
MutableHandleValueVector
MutableHandle_ElementType
NativeImpl
NativeStackBase
NativeStackLimit
NativeStackSize
ObjectPrivateVisitor_GetISupportsFun
OutOfMemoryCallback
Unlike the error reporter, which is only called if the exception for an OOM bubbles up and is not caught, the OutOfMemoryCallback is called immediately at the OOM site to allow the embedding to capture the current state of heap allocation before anything is freed. If the large-allocation-failure callback is called at all (not all allocation sites call the large-allocation-failure callback on failure), it is called before the out-of-memory callback; the out-of-memory callback is only called if the allocation still fails after the large-allocation-failure callback has returned.
PersistentRootedBigInt
PersistentRootedFunction
PersistentRootedId
PersistentRootedIdVector
PersistentRootedObject
A copyable, assignable global GC root type with arbitrary lifetime, an infallible constructor, and automatic unrooting on destruction.
PersistentRootedObjectVector
PersistentRootedScript
PersistentRootedString
PersistentRootedSymbol
PersistentRootedValue
PersistentRootedVector_Base
A copyable, assignable global GC root type with arbitrary lifetime, an infallible constructor, and automatic unrooting on destruction.
PersistentRootedVector_Vec
PersistentRooted_ElementType
PointerHasher
PreserveWrapperCallback
PromiseRejectionTrackerCallback
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.
RealmNameCallback
RealmStatsVector
RealmStats_ClassesHashMap
ReduceMicrosecondTimePrecisionCallback
RefPtr_Proxy_member_function
RefPtr_element_type
RegExpFlags_Flag
RegisterThreadCallback
ReportStreamErrorCallback
Result
Result is intended to be the return type of JSAPI calls and internal functions that can run JS code or allocate memory from the JS GC heap. Such functions can:
Rooted
RootedBigInt
RootedField_ElementType
RootedField_WrapperT
RootedFunction
RootedGCThingTraits_PersistentBase
RootedGCThingTraits_StackBase
RootedId
RootedListHeads
EnumeratedArray is a fixed-size array container for use when an array is indexed by a specific enum class.
RootedObject
Local variable of type T whose value is always rooted. This is typically used for local variables, or for non-rooted values being passed to a function that requires a handle, e.g. Foo(Root(cx, x)).
RootedScript
RootedString
RootedSymbol
RootedTraceableTraits_PersistentBase
RootedTraceableTraits_StackBase
RootedTraits
RootedValue
Local variable of type T whose value is always rooted. This is typically used for local variables, or for non-rooted values being passed to a function that requires a handle, e.g. Foo(Root(cx, x)).
Rooted_ElementType
RuntimeSizes_ScriptSourcesHashMap
ScriptPrivateReferenceHook
Hooks called when references to a script private value are created or destroyed. This allows use of a reference counted object as the script private.
ScriptVector
SecurityWrapper_Permissive
SecurityWrapper_Restrictive
SelfHostedCache
Span - slices for C++
SelfHostedWriter
SetPropertyOp
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.
SliceBudget_InterruptRequestFlag
SourceText_CharT
StableCellHasher_Key
StableCellHasher_Lookup
StackCapture
mozilla::Variant
StackGCVector
Stencil
StringVector
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.
TenuredHeap_ElementType
TranscodeBuffer
TranscodeRange
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.
TwoByteCharsZ_Base
TwoByteCharsZ_CharT
TwoByteChars_Base
TwoByteChars_CharT
TypedArray_DataType
UTF8CharsZ_Base
UTF8CharsZ_CharT
UTF8Chars_Base
UTF8Chars_CharT
Uint8Array
Uint8ClampedArray
Uint16Array
Uint32Array
Uint64Limits
UniqueChars
UniqueLatin1Chars
UniquePtr
UniqueSelector_SingleObject
UniquePtr is a smart pointer that wholly owns a resource. Ownership may be transferred out of a UniquePtr through explicit action, but otherwise the resource is destroyed when the UniquePtr is destroyed.
UniqueTwoByteChars
UniqueWideChars
UnregisterThreadCallback
UnusedZero_StorageType
ValueVector
Value_PayloadType
Vector
WarningReporter
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.
ZoneStatsVector
ZoneStats_StringsHashMap
_IO_lock_t
__builtin_va_list
__gnuc_va_list
__off64_t
__off_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
RealmCreationOptions__bindgen_ty_1
pthread_rwlock_t