Module js::jsapi
[−]
[src]
Structs
AllCompartments | |
AllocationMetadataBuilder | |
AsmJSCacheOps | |
AutoAssertGCCallback | |
AutoAssertNoAlloc |
Assert if an allocation of a GC thing occurs while this class is live. This class does not disable the static rooting hazard analysis. |
AutoAssertOnGC |
Assert if a GC occurs while this class is live. This class does not disable the static rooting hazard analysis. |
AutoCTypesActivityCallback | |
AutoCheckCannotGC |
Place AutoCheckCannotGC in scopes that you believe can never GC. These annotations will be verified both dynamically via AutoAssertOnGC, and statically with the rooting hazard analysis (implemented by making the analysis consider AutoCheckCannotGC to be a GC pointer, and therefore complain if it is live across a GC call.) It is useful when dealing with internal pointers to GC things where the GC thing itself may not be present for the static analysis: e.g. acquiring inline chars from a JSString* on the heap. |
AutoCleanLinkedList | |
AutoDisableGenerationalGC |
Ensure that generational GC is disabled within some scope. |
AutoFilename | |
AutoGCRooter | |
AutoHideScriptedCaller | |
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 |
This class can be used to store a pointer to the youngest frame of a saved stack in the specified JSContext. This reference will be picked up by any new calls performed until the class is destroyed, with the specified asyncCause, that must not be empty. |
AutoSuppressGCAnalysis |
Disable the static rooting hazard analysis in the live region and assert if any allocation that could potentially trigger a GC occurs while this guard object is live. This is most useful to help the exact rooting hazard analysis in complex regions, since it cannot understand dataflow. |
AutoTracingDetails | |
AutoTracingIndex | |
AutoTracingName | |
AutoVectorRooter | |
AutoVectorRooterBase | |
BarrierMethods | |
BaseShape | |
CStringHashPolicy | |
CStringHasher | |
CallArgs | |
CallArgsBase | |
CallbackTracer | |
CallbackTracer_ContextFunctor | |
ChromeCompartmentsOnly | |
Class | |
ClassExtension | |
ClassInfo | |
ClassOps | |
ClassSpec | |
CodeSizes |
Data for tracking JIT-code memory usage. |
CompartmentBehaviors |
CompartmentBehaviors specifies behaviors of a compartment that can be changed after the compartment's been created. |
CompartmentBehaviors_Override | |
CompartmentCreationOptions |
CompartmentCreationOptions specifies options relevant to creating a new compartment, that are either immutable characteristics of that compartment or that are discarded after the compartment has been created. |
CompartmentCreationOptions_jsapi_h_unnamed_8 | |
CompartmentFilter | |
CompartmentOptions |
CompartmentOptions specifies compartment characteristics: both those that can't be changed on a compartment once it's been created (CompartmentCreationOptions), and those that can be changed on an existing compartment (CompartmentBehaviors). |
CompartmentStats | |
CompartmentsWithPrincipals | |
CompileOptions | |
ContentCompartmentsOnly | |
ContextFriendFields | |
CustomAutoRooter |
Custom rooting behavior for internal and external clients. |
DispatchWrapper | |
ElementAdder | |
EnumeratedArray | |
ExpandoAndGeneration | |
FakeMutableHandle |
Interface substitute for MutableHandle |
FakeRooted |
Interface substitute for Rooted |
ForOfIterator |
Convenience class for imitating a JS level for-of loop. Typical usage: |
Function | |
GCCellPtr |
A GC pointer, tagged with the trace kind. |
GCDescription | |
GCHeapProfiler | |
GCPointerPolicy | |
GCPolicy | |
GCSizes |
Data for tracking GC memory usage. |
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. |
HandleBase | |
HandleValueArray |
A handle to an array of rooted values. |
HashMapEntry | |
Heap | |
HeapBase | |
IdentityDefaultAdaptor | |
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. |
JSAutoByteString | |
JSAutoCompartment | |
JSAutoNullableCompartment | |
JSAutoRequest | |
JSAutoStructuredCloneBuffer |
RAII sugar for JS_WriteStructuredClone. |
JSClass | |
JSClassOps | |
JSConstScalarSpec | |
JSDOMCallbacks | |
JSErrorFormatString | |
JSErrorReport | |
JSFreeOp | |
JSFunctionSpec |
To define a native function, set call to a JSNativeWrapper. To define a self-hosted function, set selfHostedName to the name of a function compiled during JSRuntime::initSelfHosting. |
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. Eventually, this should be made available to general JSAPI users, but we are not currently ready to do so. |
JSJitMethodCallArgs |
A class, expected to be passed by reference, which represents the CallArgs for a JSJitMethodOp. |
JSJitMethodCallArgsTraits | |
JSJitSetterCallArgs |
A class, expected to be passed by value, which represents the CallArgs for a JSJitSetterOp. |
JSLocaleCallbacks |
Locale specific string conversion and error message callbacks. |
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. |
JSPrincipals | |
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_SelfHostedWrapper | |
JSSecurityCallbacks | |
JSStringFinalizer |
Finalizes external strings created by JS_NewExternalString. |
JSStructuredCloneCallbacks | |
JSTracer | |
JSTypedMethodJitInfo | |
JSWrapObjectCallbacks | |
LinkedList | |
LinkedListElement | |
LinkedList_Iterator | |
MallocAllocPolicy | |
MapTypeToRootKind | |
MapTypeToTraceKind | |
MemProfiler | |
MovableCellHasher | |
MutableHandle |
Similar to a handle, but the underlying storage can be changed. This is useful for outparams. |
MutableHandleBase | |
MutablePropertyDescriptorOperations | |
MutableValueOperations |
A class designed for CRTP use in implementing all the mutating parts of the
Value interface in Value-like classes. Outer must be a class inheriting
MutableValueOperations |
NativeProfiler | |
NoUsedRval | |
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. |
Object |
This layout is shared by all native objects. For non-native objects, the group may always be accessed safely, and other members may be as well, depending on the object's specific layout. |
ObjectGroup | |
ObjectOpResult |
Per ES6, the [[DefineOwnProperty]] internal method has three different possible outcomes: |
ObjectOps | |
ObjectPrivateVisitor | |
ObjectPtr | |
Opaque |
Opaque |
OwningCompileOptions | |
PerThreadDataFriendFields | |
PerThreadDataFriendFields_RuntimeDummy | |
PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy | |
PerformanceGroup |
Abstract base class for a representation of the performance of a component. Embeddings interested in performance monitoring should provide a concrete implementation of this class, as well as the relevant callbacks (see below). |
PersistentRooted |
A copyable, assignable global GC root type with arbitrary lifetime, an infallible constructor, and automatic unrooting on destruction. |
PersistentRootedBase | |
PersistentRootedMarker | |
PropertyDescriptor | |
PropertyDescriptorOperations | |
Range | |
RangedPtr | |
ReadOnlyCompileOptions | |
RootLists | |
Rooted |
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 |
RootedBase | |
Runtime | |
RuntimeOptions | |
RuntimeSizes |
These measurements relate directly to the JSRuntime, and not to zones and compartments within it. |
RuntimeStats | |
ScriptEnvironmentPreparer |
If the embedder has registered a ScriptEnvironmentPreparer, PrepareScriptEnvironmentAndInvoke will call 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 |scope|, invoke |closure| with a valid JSContext*, report any exceptions thrown from the closure, and return. |
ScriptEnvironmentPreparer_Closure | |
ScriptSourceInfo |
This class holds information about the memory taken up by script sources from a particular file. |
ServoSizes |
These are the measurements used by Servo. |
Shape | |
SingleCompartment | |
SourceBufferHolder |
Container class for passing in script source buffers to the JS engine. This not only groups the buffer and length values, it also provides a way to optionally pass ownership of the buffer to the JS engine without copying. Rules for use: |
SourceHook |
A class of objects that return source code on demand. |
String | |
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. |
String_jsfriendapi_h_unnamed_13 | |
StructGCPolicy | |
SystemAllocPolicy | |
TabSizes | |
TempAllocPolicy | |
TenuredHeap |
The TenuredHeap |
TransitiveCompileOptions |
The common base class for the CompileOptions hierarchy. |
UnusedGCThingSizes | |
Value |
JS::Value is the interface for a single JavaScript Engine value. A few general notes on JS::Value: |
ValueOperations |
A class designed for CRTP use in implementing the non-mutating parts of the
Value interface in Value-like classes. Outer must be a class inheriting
ValueOperations |
VoidDefaultAdaptor | |
WeakMapTracer | |
Zone | |
ZoneStats | |
__BindgenUnionField | |
_vftable_CallbackTracer | |
_vftable_CompartmentFilter | |
_vftable_CustomAutoRooter | |
_vftable_GCHeapProfiler | |
_vftable_JSPrincipals | |
_vftable_NativeProfiler | |
_vftable_ObjectPrivateVisitor | |
_vftable_PerformanceGroup | |
_vftable_ScriptEnvironmentPreparer | |
_vftable_SourceHook | |
_vftable_TransitiveCompileOptions | |
_vftable_WeakMapTracer | |
jsid | |
jsval_layout | |
jsval_layout_Value_h_unnamed_5 | |
jsval_layout_Value_h_unnamed_5_Value_h_unnamed_6 |
Enums
AllocFunction | |
AllowGC |
Types for a variable that either should or shouldn't be rooted, depending on the template parameter allowGC. Used for implementing functions that can operate on either rooted or unrooted data. |
AsmJSCacheResult |
The list of reasons why an asm.js module may not be stored in the cache. |
AsmJSOption | |
AutoGCRooter_jspubtd_h_unnamed_1 | |
AutoSetAsyncStackForNewCalls_AsyncCallKind | |
AutoStopwatch | |
AutoTraceSession | |
AutoTracingCallback | |
BaseProxyHandler | |
CTypesActivityType | |
Cell | |
CompartmentBehaviors_Override_Mode | |
DOMProxyShadowsResult | |
DetachDataDisposition | |
ESClass |
Enumeration describing possible values of the [[Class]] internal property value of objects. |
ElementAdder_GetBehavior | |
ExclusiveContext | |
ForOfIterator_NonIterableBehavior | |
FreeOp | |
GCNurseryProgress |
Describes the progress of an observed nursery collection. |
GCProgress | |
GCRuntime | |
Handle_CallerIdentity | |
Handle_Disambiguator | |
HeapState | |
InitState | |
InlinableNative | |
InterpreterFrame | |
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|). |
JSAddonId | |
JSAtom | |
JSAtomState | |
JSAutoStructuredCloneBuffer_StructuredClone_h_unnamed_7 | |
JSCompartment | |
JSContext | |
JSCrossCompartmentCall | |
JSErrNum |
Report an exception, which is currently realized as a printf-style format string and its arguments. |
JSExceptionState | |
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 | |
JSFlatString | |
JSFunction | |
JSGCInvocationKind |
Kinds of js_GC invocation. |
JSGCMode | |
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 | |
JSLinearString | |
JSObject | |
JSObjectMap | |
JSPropertyName | |
JSProtoKey | |
JSRuntime | |
JSScript | |
JSString | |
JSStructuredCloneReader | |
JSStructuredCloneWriter | |
JSTracer_TracerKindTag | |
JSType | |
JSValueShiftedTag | |
JSValueTag | |
JSValueType | |
JSVersion | |
JSWhyMagic | |
JitCode | |
LazyScript | |
LinkedListElement_NodeKind | |
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. |
PRCallOnceType | |
PerThreadData | |
PromiseRejectionHandlingState | |
PromiseState | |
PropertyDescriptorOperations_jsapi_h_unnamed_9 | |
Reason | |
RegExpGuard | |
RootKind | |
SavedFrameResult | |
SavedFrameSelfHosted | |
ScriptSource | |
ServoSizes_Kind | |
SourceBufferHolder_Ownership | |
StackKind | |
Statistics | |
StoreBuffer | |
Symbol | |
SymbolCode | |
TabSizes_Kind | |
TenuredHeap_RootingAPI_h_unnamed_4 | |
TraceKind | |
TransferableOwnership | |
TwoByteChars | |
Type |
Scalar types that can appear in typed arrays and typed objects. The enum values must to be kept in sync with the JS_SCALARTYPEREPR_ constants, as well as the TypedArrayObject::classes and TypedArrayObject::protoClasses definitions. |
VectorTesting | |
WeakMapTraceKind | |
ZoneSpecifier | |
jsfriendapi_h_unnamed_10 | |
jsfriendapi_h_unnamed_11 | |
jsfriendapi_h_unnamed_12 | |
nsISupports |
Constants
Statics
Functions
AbortIncrementalGC⚠ |
If IsIncrementalGCInProgress(rt), 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(rt) will always be false. |
AddCPOWPerformanceDelta⚠ |
Add a number of microseconds to the time spent waiting on CPOWs since process start. |
AddPromiseReactions⚠ |
Unforgeable, optimized version of the JS builtin Promise.prototype.then. |
AddRawValueRoot⚠ | |
AddServoSizeOf⚠ | |
AddSizeOfTab⚠ | |
AddonIdOfObject⚠ | |
AppendUnique⚠ | |
AreGCGrayBitsValid⚠ | |
AssertHeapIsIdle⚠ | |
AssertSameCompartment⚠ | |
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 |
CallOriginalPromiseResolve⚠ |
Calls the current compartment's original Promise.resolve on the original
Promise constructor, with |
CallOriginalPromiseThen⚠ |
Calls the current compartment's original Promise.prototype.then on the
given |
CanCompileOffThread⚠ | |
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. If |maxFrameCount| is non-zero, capture at most the youngest |maxFrameCount| frames. |
CloneAndExecuteScript⚠ |
Like the above, but handles a cross-compartment script. If the script is cross-compartment, it is cloned into the current compartment before executing. |
CloneFunctionObject⚠ |
Clone a top-level function into cx's global. This function will dynamically fail if funobj was lexically nested inside some other function. |
CloneFunctionObject1⚠ |
As above, but providing an explicit scope chain. scopeChain must not include the global object on it; that's implicit. It needs to contain the other objects that should end up on the clone's scope chain. |
CollectRuntimeStats⚠ | |
CompartmentBehaviorsRef⚠ | |
CompartmentBehaviorsRef1⚠ | |
CompartmentBehaviorsRef2⚠ | |
CompartmentCreationOptionsRef⚠ | |
CompartmentCreationOptionsRef1⚠ | |
CompartmentCreationOptionsRef2⚠ | |
Compile⚠ |
|script| will always be set. On failure, it will be set to nullptr. |
Compile1⚠ | |
Compile2⚠ | |
Compile3⚠ | |
Compile4⚠ | |
CompileForNonSyntacticScope⚠ | |
CompileForNonSyntacticScope1⚠ | |
CompileForNonSyntacticScope2⚠ | |
CompileForNonSyntacticScope3⚠ | |
CompileForNonSyntacticScope4⚠ | |
CompileFunction⚠ |
Compile a function with scopeChain plus the global as its scope chain. scopeChain 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⚠ |
Same as above, but taking a SourceBufferHolder for the function body. |
CompileFunction2⚠ |
Same as above, but taking a const char * for the function body. |
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. |
CompileOffThread⚠ | |
CompileOffThreadModule⚠ | |
ComputeThis⚠ | |
Construct⚠ |
Invoke a constructor. This is the C++ equivalent of
|
Construct1⚠ |
Invoke a constructor. This is the C++ equivalent of
|
ConvertArgsToArray⚠ | |
CopyAsyncStack⚠ | |
CreateError⚠ | |
CurrentGlobalOrNull⚠ | |
CurrentThreadCanAccessRuntime⚠ | |
CurrentThreadCanAccessZone⚠ | |
DateGetMsecSinceEpoch⚠ | |
DateIsValid⚠ |
Detect whether the internal date value is NaN. |
DefineFunctionWithReserved⚠ | |
DescribeScriptedCaller⚠ |
Return the current filename, line number and column number of the most currently running frame. Returns true if a scripted frame was found, false otherwise. |
DisableIncrementalGC⚠ |
Incremental GC defaults to enabled, but may be disabled for testing or in embeddings that have not yet implemented barriers on their native classes. There is not currently a way to re-enable incremental GC once it has been disabled on the runtime. |
DisposePerformanceMonitoring⚠ |
Cleanup any memory used by performance monitoring. |
DumpBacktrace⚠ | |
DumpBacktrace1⚠ | |
DumpHeap⚠ |
Dump the complete object graph of heap-allocated things. fp is the file for the dump output. |
Evaluate⚠ |
Evaluate the given source buffer in the scope of the current global of cx. |
Evaluate1⚠ |
As above, but providing an explicit scope chain. scopeChain 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 given character buffer in the scope of the current global of cx. |
Evaluate3⚠ |
As above, but providing an explicit scope chain. scopeChain 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. |
Evaluate4⚠ |
Evaluate the given byte buffer in the scope of the current global of cx. |
Evaluate5⚠ |
Evaluate the given file in the scope of the current global of cx. |
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. |
ExecuteInGlobalAndReturnScope⚠ | |
ExplainReason⚠ |
Get a statically allocated C string explaining the given GC reason. |
FinishIncrementalGC⚠ |
If IsIncrementalGCInProgress(rt), this call finishes the ongoing collection by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(rt), this is equivalent to GCForReason. When this function returns, IsIncrementalGCInProgress(rt) will always be false. |
FinishOffThreadModule⚠ | |
FinishOffThreadScript⚠ | |
FlushPerformanceMonitoring⚠ |
Commit any Performance Monitoring data. |
ForceLexicalInitialization⚠ |
Set all of the uninitialized lexicals on an object to undefined. Return true if any lexicals were initialized and false otherwise. |
FormatStackDump⚠ |
Exposed for DumpJSStack |
ForwardToNative⚠ | |
FromPropertyDescriptor⚠ | |
FunctionHasNativeReserved⚠ | |
GCForReason⚠ |
Performs a non-incremental collection of all selected zones. |
GCThingTraceKind⚠ | |
GCTraceKindToAscii⚠ |
Returns a static string equivalent of |kind|. |
GetAllocationMetadata⚠ |
Get the metadata associated with an object. |
GetAnyCompartmentInZone⚠ | |
GetArrayBufferLengthAndData⚠ | |
GetArrayBufferViewLengthAndData⚠ | |
GetBuiltinClass⚠ | |
GetCodeCoverageSummary⚠ |
Generate lcov trace file content for the current compartment, and allocate a new buffer and return the content in it, the size of the newly allocated content within the buffer would be set to the length out-param. |
GetCompartmentZone⚠ | |
GetDOMCallbacks⚠ | |
GetDOMProxyExpandoSlot⚠ | |
GetDOMProxyHandlerFamily⚠ | |
GetDOMProxyShadowsCheck⚠ | |
GetElementsWithAdder⚠ | |
GetErrorMessage⚠ | |
GetErrorTypeName⚠ |
Get an error type name from a JSExnType constant. Returns nullptr for invalid arguments and JSEXN_INTERNALERR |
GetFirstArgumentAsTypeHint⚠ |
If args.get(0) is one of the strings "string", "number", or "default", set *result to JSTYPE_STRING, JSTYPE_NUMBER, or JSTYPE_VOID accordingly and return true. Otherwise, return false with a TypeError pending. |
GetFirstSubsumedSavedFrame⚠ |
Get the first SavedFrame object in this SavedFrame stack whose principals are subsumed by the cx's principals. If there is no such frame, return nullptr. |
GetFunctionNativeReserved⚠ | |
GetGCNumber⚠ |
Returns the GC's "number". This does not correspond directly to the number of GCs that have been run, but is guaranteed to be monotonically increasing with GC activity. |
GetGlobalForObjectCrossCompartment⚠ | |
GetModuleHostDefinedField⚠ |
Get the [[HostDefined]] field of a source text module record. |
GetModuleResolveHook⚠ |
Get the HostResolveImportedModule hook for a global. |
GetModuleScript⚠ | |
GetNearestEnclosingWithScopeObjectForFunction⚠ |
Get the nearest enclosing with scope object for a given function. If the function is not scripted or is not enclosed by a with scope, returns the global. |
GetObjectProto⚠ | |
GetObjectSlotSpan⚠ | |
GetObjectZone⚠ | |
GetOriginalEval⚠ | |
GetOutermostEnclosingFunctionOfScriptedCaller⚠ |
Return the outermost enclosing function (script) of the scripted caller. This function returns nullptr in several cases: - no script is running on the context - the caller is in global or eval code In particular, this function will "stop" its outermost search at eval() and thus it will really return the outermost enclosing function since the innermost eval. |
GetPCCountScriptContents⚠ | |
GetPCCountScriptCount⚠ | |
GetPCCountScriptSummary⚠ | |
GetPerfMonitoringTestCpuRescheduling⚠ | |
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. |
GetPromisePrototype⚠ |
Returns the current compartment's original Promise.prototype. |
GetPromiseResolutionSite⚠ | |
GetPromiseResult⚠ |
Returns the given Promise's result: either the resolution value for fulfilled promises, or the rejection reason for rejected ones. |
GetPromiseState⚠ |
Returns the given Promise's state as a JS::PromiseState enum value. |
GetPropertyKeys⚠ |
Add some or all property keys of obj to the id vector *props. |
GetPropertyNameFromPC⚠ | |
GetPrototypeNoProxy⚠ | |
GetRequestedModules⚠ | |
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 |
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. 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 |
GetSavedFrameSource⚠ |
Given a SavedFrame JSObject, get its source property. Defaults to the empty string. |
GetScriptedCallerGlobal⚠ | |
GetSelfHostedFunction⚠ | |
GetSharedArrayBufferLengthAndData⚠ | |
GetStaticPrototype⚠ | |
GetStopwatchIsMonitoringCPOW⚠ | |
GetStopwatchIsMonitoringJank⚠ | |
GetSymbolCode⚠ |
Return the SymbolCode telling what sort of symbol |
GetSymbolDescription⚠ |
Get the [[Description]] attribute of the given symbol. |
GetSymbolFor⚠ |
Symbol.for as specified in ES6. |
GetTestingFunctions⚠ | |
GetWaitForAllPromise⚠ |
Unforgeable version of the JS builtin Promise.all. |
GetWarningReporter⚠ | |
GetWeakMapEntry⚠ | |
GetWeakmapKeyDelegate⚠ | |
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. |
HeapObjectPostBarrier⚠ | |
HeapValuePostBarrier⚠ | |
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. |
INTERNED_STRING_TO_JSID⚠ |
Only JSStrings that have been interned via the JSAPI can be turned into jsids by API clients. |
IdMatchesAtom⚠ | |
IdentifyStandardConstructor⚠ | |
IdentifyStandardInstance⚠ | |
IdentifyStandardInstanceOrPrototype⚠ | |
IdentifyStandardPrototype⚠ | |
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(rt). |
IncrementalObjectBarrier⚠ | |
IncrementalReferenceBarrier⚠ | |
IncrementalValueBarrier⚠ | |
InitSelfHostedCode⚠ |
Initialize the runtime's self-hosted code. Embeddings should call this exactly once per runtime/context, before the first JS_NewGlobalObject call. |
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. |
IsAtomsCompartment⚠ | |
IsAtomsZone⚠ | |
IsCallable⚠ |
Return true if the given object is callable. In ES6 terms, an object is callable if it has a [[Call]] internal method. |
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
|
IsFunctionObject⚠ | |
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. |
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. |
IsObjectInContextCompartment⚠ | |
IsPromiseObject⚠ |
Returns true if the given object is an unwrapped PromiseObject, false otherwise. |
IsSavedFrame⚠ |
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. |
IsStopwatchActive⚠ | |
IsSystemCompartment⚠ | |
IsSystemZone⚠ | |
IsWeakMapObject⚠ | |
IsWindowProxy⚠ |
Returns true iff |
IsWindowSlow⚠ | |
IterateGrayObjects⚠ |
Invoke cellCallback on every gray JS_OBJECT in the given zone. |
JS_AbortIfWrongThread⚠ |
A JS runtime always has an "owner thread". The owner thread is set when the runtime is created (to the current thread) and practically all entry points into the JS engine check that a runtime (or anything contained in the runtime: context, 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_AddWeakPointerCompartmentCallback⚠ | |
JS_AddWeakPointerZoneGroupCallback⚠ | |
JS_AlreadyHasOwnElement⚠ | |
JS_AlreadyHasOwnProperty⚠ | |
JS_AlreadyHasOwnPropertyById⚠ | |
JS_AlreadyHasOwnUCProperty⚠ | |
JS_ArrayBufferHasData⚠ |
Return true if the arrayBuffer contains any data. This will return false for ArrayBuffer.prototype and detached ArrayBuffers. |
JS_AtomizeAndPinJSString⚠ | |
JS_AtomizeAndPinString⚠ | |
JS_AtomizeAndPinStringN⚠ | |
JS_AtomizeAndPinUCString⚠ | |
JS_AtomizeAndPinUCStringN⚠ | |
JS_AtomizeString⚠ | |
JS_AtomizeStringN⚠ | |
JS_AtomizeUCString⚠ | |
JS_AtomizeUCStringN⚠ | |
JS_BasicObjectToString⚠ | |
JS_BeginRequest⚠ | |
JS_BufferIsCompilableUnit⚠ |
Given a buffer, return false if the buffer might become a valid javascript statement with the addition of more lines. Otherwise return true. The intent is to support interactive compilation - accumulate lines in a buffer until JS_BufferIsCompilableUnit is true, then pass it to the compiler. |
JS_CallFunction⚠ | |
JS_CallFunctionName⚠ |
Perform the method call |
JS_CallFunctionValue⚠ |
Call a function, passing a this-value and arguments. This is the C++
equivalent of |
JS_CallOnce⚠ |
The first call to JS_CallOnce by any thread in a process will call 'func'. Later calls to JS_CallOnce with the same JSCallOnceType object will be suppressed. |
JS_CharsToId⚠ |
Convert chars into a jsid. |
JS_CheckForInterrupt⚠ | |
JS_ClearPendingException⚠ | |
JS_ClearRegExpStatics⚠ | |
JS_ClearStructuredClone⚠ | |
JS_CloneObject⚠ | |
JS_CompareStrings⚠ | |
JS_CompileScript⚠ |
|script| will always be set. On failure, it will be set to nullptr. |
JS_CompileUCScript⚠ |
|script| will always be set. On failure, it will be set to nullptr. |
JS_ConcatStrings⚠ |
Concatenate two strings, possibly resulting in a rope. See above for thread safety comments. |
JS_CopyPropertiesFrom⚠ |
Copies all own properties from |obj| to |target|. |obj| must be a "native" object (that is to say, normal-ish - not an Array or a Proxy). |
JS_CopyPropertyFrom⚠ | |
JS_CopyStringChars⚠ | |
JS_CreateMappedArrayBufferContents⚠ |
Create memory mapped array buffer contents. Caller must take care of closing fd after calling this function. |
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_DecodeInterpretedFunction⚠ | |
JS_DecodeScript⚠ | |
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_DefineConstDoubles⚠ | |
JS_DefineConstIntegers⚠ | |
JS_DefineDebuggerObject⚠ | |
JS_DefineElement⚠ | |
JS_DefineElement1⚠ | |
JS_DefineElement2⚠ | |
JS_DefineElement3⚠ | |
JS_DefineElement4⚠ | |
JS_DefineElement5⚠ | |
JS_DefineFunction⚠ | |
JS_DefineFunctionById⚠ | |
JS_DefineFunctions⚠ | |
JS_DefineFunctionsWithHelp⚠ | |
JS_DefineObject⚠ | |
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_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 |
JS_DefinePropertyById2⚠ | |
JS_DefinePropertyById3⚠ | |
JS_DefinePropertyById4⚠ | |
JS_DefinePropertyById5⚠ | |
JS_DefinePropertyById6⚠ | |
JS_DefinePropertyById7⚠ | |
JS_DefineUCFunction⚠ | |
JS_DefineUCProperty⚠ | |
JS_DefineUCProperty1⚠ | |
JS_DefineUCProperty2⚠ | |
JS_DefineUCProperty3⚠ | |
JS_DefineUCProperty4⚠ | |
JS_DefineUCProperty5⚠ | |
JS_DefineUCProperty6⚠ | |
JS_DefineUCProperty7⚠ | |
JS_DeleteElement⚠ | |
JS_DeleteElement1⚠ | |
JS_DeleteProperty⚠ | |
JS_DeleteProperty1⚠ | |
JS_DeletePropertyById⚠ |
Delete a property. This is the C++ equivalent of
|
JS_DeletePropertyById1⚠ |
Delete a property, ignoring strict failures. This is the C++ equivalent of
the JS |
JS_DeleteUCProperty⚠ | |
JS_DestroyRuntime⚠ | |
JS_DetachArrayBuffer⚠ |
Detach an ArrayBuffer, causing all associated views to no longer refer to the ArrayBuffer's original attached memory. |
JS_DoubleIsInt32⚠ | |
JS_DropExceptionState⚠ | |
JS_DropPrincipals⚠ | |
JS_EncodeInterpretedFunction⚠ | |
JS_EncodeScript⚠ | |
JS_EncodeString⚠ |
A variation on JS_EncodeCharacters where a null terminated string is returned that you are expected to call JS_free on when done. |
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_EncodeStringToUTF8⚠ |
Same behavior as JS_EncodeString(), but encode into UTF-8 string |
JS_EndRequest⚠ | |
JS_EnterCompartment⚠ |
NB: This API is infallible; a nullptr return value does not indicate error. |
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_ExecuteRegExp⚠ | |
JS_ExecuteRegExpNoStatics⚠ | |
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. scopeChain 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_ExtensibleLexicalScope⚠ | |
JS_FileEscapedString⚠ | |
JS_FindCompilationScope⚠ | |
JS_FireOnNewGlobalObject⚠ | |
JS_FlatStringEqualsAscii⚠ | |
JS_FlattenString⚠ | |
JS_ForwardGetElementTo⚠ | |
JS_ForwardGetPropertyTo⚠ |
Get the value of the property |
JS_ForwardSetPropertyTo⚠ |
Perform the same property assignment as |
JS_FreezeObject⚠ |
Freezes an object; see ES5's Object.freeze(obj) method. |
JS_GC⚠ | |
JS_GetArrayBufferByteLength⚠ |
Return the available byte length of an array buffer. |
JS_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. |
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_GetArrayBufferViewData⚠ |
Same as above, but for any kind of ArrayBufferView. Prefer the type-specific versions when possible. |
JS_GetArrayBufferViewType⚠ | |
JS_GetArrayLength⚠ | |
JS_GetArrayPrototype⚠ |
Returns the original value of |Array.prototype| from the global object in which |forObj| was created. |
JS_GetClass⚠ | |
JS_GetClassObject⚠ | |
JS_GetClassPrototype⚠ | |
JS_GetCompartmentPrincipals⚠ | |
JS_GetCompartmentPrivate⚠ | |
JS_GetConstructor⚠ | |
JS_GetContext⚠ |
Returns the runtime's JSContext. The plan is to expose a single type to the API, so this function will likely be removed soon. |
JS_GetCurrentEmbedderTime⚠ |
Return the time as computed using the current time function, or a suitable default if one has not been set. |
JS_GetCurrentThread⚠ | |
JS_GetCustomIteratorCount⚠ | |
JS_GetDataViewByteLength⚠ |
Return the byte length of a data view. |
JS_GetDataViewByteOffset⚠ |
Return the byte offset of a data view into its array buffer. |obj| must be a DataView. |
JS_GetDataViewData⚠ |
Return a pointer to the beginning of the data referenced by a DataView. |
JS_GetDefaultFreeOp⚠ | |
JS_GetElement⚠ | |
JS_GetEmptyString⚠ | |
JS_GetEmptyStringValue⚠ | |
JS_GetErrorPrototype⚠ |
Returns the original value of |Error.prototype| from the global object of the current compartment of cx. |
JS_GetExternalStringFinalizer⚠ |
Return the 'fin' arg passed to JS_NewExternalString. |
JS_GetFlatStringCharAt⚠ | |
JS_GetFloat32ArrayData⚠ | |
JS_GetFloat64ArrayData⚠ | |
JS_GetFunctionArity⚠ | |
JS_GetFunctionDisplayId⚠ |
Return a function's display name. This is the defined name if one was given where the function was defined, or it could be an inferred name by the JS engine in the case that the function was defined to be anonymous. This can still return nullptr if a useful display name could not be inferred. The same restrictions on rooting as those in JS_GetFunctionId apply. |
JS_GetFunctionId⚠ |
Return the function's identifier as a JSString, or null if fun is unnamed. The returned string lives as long as fun, so you don't need to root a saved reference to it if fun is well-connected or rooted, and provided you bound the use of the saved reference by fun's lifetime. |
JS_GetFunctionObject⚠ | |
JS_GetFunctionPrototype⚠ |
Returns the original value of |Function.prototype| from the global object in which |forObj| was created. |
JS_GetFunctionScript⚠ | |
JS_GetGCParameter⚠ | |
JS_GetGlobalForCompartmentOrNull⚠ |
May return nullptr, if |c| never had a global (e.g. the atoms compartment), or if |c|'s global has been collected. |
JS_GetGlobalForObject⚠ | |
JS_GetGlobalFromScript⚠ | |
JS_GetGlobalJitCompilerOption⚠ | |
JS_GetImplementationVersion⚠ | |
JS_GetInstancePrivate⚠ | |
JS_GetInt16ArrayData⚠ | |
JS_GetInt32ArrayData⚠ | |
JS_GetInt8ArrayData⚠ | |
JS_GetInterruptCallback⚠ | |
JS_GetIsSecureContext⚠ | |
JS_GetIteratorPrototype⚠ |
Returns the %IteratorPrototype% object that all built-in iterator prototype chains go through for the global object of the current compartment of cx. |
JS_GetLatin1FlatStringChars⚠ | |
JS_GetLatin1StringCharsAndLength⚠ | |
JS_GetLocaleCallbacks⚠ |
Return the address of the current locale callbacks struct, which may be nullptr. |
JS_GetNaNValue⚠ |
Don't want to export data, so provide accessors for non-inline Values. |
JS_GetNegativeInfinityValue⚠ | |
JS_GetObjectAsArrayBuffer⚠ | |
JS_GetObjectAsArrayBufferView⚠ | |
JS_GetObjectAsFloat32Array⚠ | |
JS_GetObjectAsFloat64Array⚠ | |
JS_GetObjectAsInt16Array⚠ | |
JS_GetObjectAsInt32Array⚠ | |
JS_GetObjectAsInt8Array⚠ | |
JS_GetObjectAsUint16Array⚠ | |
JS_GetObjectAsUint32Array⚠ | |
JS_GetObjectAsUint8Array⚠ | |
JS_GetObjectAsUint8ClampedArray⚠ | |
JS_GetObjectFunction⚠ | |
JS_GetObjectPrototype⚠ |
Returns the original value of |Object.prototype| from the global object in which |forObj| was created. |
JS_GetObjectRuntime⚠ | |
JS_GetOwnPropertyDescriptor⚠ | |
JS_GetOwnPropertyDescriptorById⚠ |
Get a description of one of obj's own properties. If no such property exists on obj, return true with desc.object() set to null. |
JS_GetOwnUCPropertyDescriptor⚠ | |
JS_GetParentRuntime⚠ | |
JS_GetPendingException⚠ | |
JS_GetPositiveInfinityValue⚠ | |
JS_GetPrivate⚠ | |
JS_GetProperty⚠ | |
JS_GetPropertyById⚠ |
Get the value of the property |
JS_GetPropertyDescriptor⚠ | |
JS_GetPropertyDescriptorById⚠ |
Like JS_GetOwnPropertyDescriptorById, but also searches the prototype chain if no own property is found directly on obj. The object on which the property is found is returned in desc.object(). If the property is not found on the prototype chain, this returns true with desc.object() set to null. |
JS_GetPrototype⚠ |
Get the prototype of obj, storing it in result. |
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_GetRegExpFlags⚠ | |
JS_GetRegExpSource⚠ | |
JS_GetReservedSlot⚠ | |
JS_GetRuntime⚠ | |
JS_GetRuntimePrivate⚠ | |
JS_GetScriptBaseLineNumber⚠ | |
JS_GetScriptFilename⚠ | |
JS_GetScriptPrincipals⚠ | |
JS_GetSecurityCallbacks⚠ | |
JS_GetSharedArrayBufferByteLength⚠ | |
JS_GetSharedArrayBufferData⚠ | |
JS_GetSharedArrayBufferViewType⚠ | |
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_GetTraceThingInfo⚠ | |
JS_GetTwoByteExternalStringChars⚠ | |
JS_GetTwoByteFlatStringChars⚠ | |
JS_GetTwoByteStringCharsAndLength⚠ | |
JS_GetTypedArrayByteLength⚠ |
Return the byte length of a typed array. |
JS_GetTypedArrayByteOffset⚠ |
Return the byte offset from the start of an array buffer 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_GetUint16ArrayData⚠ | |
JS_GetUint32ArrayData⚠ | |
JS_GetUint8ArrayData⚠ | |
JS_GetUint8ClampedArrayData⚠ | |
JS_GetVersion⚠ | |
JS_GetZoneUserData⚠ | |
JS_GlobalLexicalScope⚠ | |
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_HasExtensibleLexicalScope⚠ | |
JS_HasInstance⚠ | |
JS_HasOwnProperty⚠ | |
JS_HasOwnPropertyById⚠ |
Determine whether obj has an own property with the key |
JS_HasProperty⚠ | |
JS_HasPropertyById⚠ |
Compute the expression |
JS_HasUCProperty⚠ | |
JS_HoldPrincipals⚠ | |
JS_IdToProtoKey⚠ | |
JS_IdToValue⚠ | |
JS_ImmutablePrototypesEnabled⚠ | |
JS_IndexToId⚠ |
Convert a uint32_t index into a jsid. |
JS_Init⚠ |
Initialize SpiderMonkey, returning true only if initialization succeeded. Once this method has succeeded, it is safe to call JS_NewRuntime and other JSAPI methods. |
JS_InitClass⚠ | |
JS_InitDestroyPrincipalsCallback⚠ | |
JS_InitReadPrincipalsCallback⚠ | |
JS_InitReflectParse⚠ |
Add 'Reflect.parse', a SpiderMonkey extension, to the Reflect object on the given global. |
JS_InitStandardClasses⚠ |
Initialize standard JS class constructors, prototypes, and any top-level functions and constants associated with the standard classes (e.g. isNaN for Number). |
JS_InitWithFailureDiagnostic⚠ |
A variant of JS_Init. On success it returns nullptr. On failure it returns a pointer to a string literal that describes how initialization failed, which can be useful for debugging purposes. |
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_IsArrayBufferObject⚠ | |
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_IsArrayObject⚠ |
Returns true and sets |*isArray| indicating whether |value| is an Array object or a wrapper around one, otherwise returns false on failure. |
JS_IsArrayObject1⚠ |
Returns true and sets |*isArray| indicating whether |obj| is an Array object or a wrapper around one, otherwise returns false on failure. |
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_IsDataViewObject⚠ |
Check whether obj supports JS_GetDataView* APIs. |
JS_IsDeadWrapper⚠ |
Determine whether the given object is backed by a DeadObjectProxy. |
JS_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. |
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_IsExternalString⚠ |
Return whether 'str' was created with JS_NewExternalString or JS_NewExternalStringWithClosure. |
JS_IsFloat32Array⚠ | |
JS_IsFloat64Array⚠ | |
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_IsInt16Array⚠ | |
JS_IsInt32Array⚠ | |
JS_IsInt8Array⚠ | |
JS_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. |
JS_IsNative⚠ | |
JS_IsNativeFunction⚠ | |
JS_IsRunning⚠ | |
JS_IsSharedArrayBufferObject⚠ | |
JS_IsStopIteration⚠ | |
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_IsUint16Array⚠ | |
JS_IsUint32Array⚠ | |
JS_IsUint8Array⚠ | |
JS_IsUint8ClampedArray⚠ | |
JS_IterateCompartments⚠ |
This function calls |compartmentCallback| on every compartment. Beware that there is no guarantee that the compartment will survive after the callback returns. Also, barriers are disabled via the TraceSession. |
JS_LeaveCompartment⚠ | |
JS_LinkConstructorAndPrototype⚠ |
Set up ctor.prototype = proto and proto.constructor = ctor with the right property flags. |
JS_LooselyEqual⚠ | |
JS_MayResolveStandardClass⚠ | |
JS_MaybeGC⚠ | |
JS_New⚠ |
Invoke a constructor, like the JS expression |
JS_NewArrayBuffer⚠ |
Create a new ArrayBuffer with the given byte length. |
JS_NewArrayBufferWithContents⚠ |
Create a new array buffer with the given contents. It must be legal to pass these contents to free(). On success, the ownership is transferred to the new array buffer. |
JS_NewArrayBufferWithExternalContents⚠ |
Create a new array buffer with the given contents. The array buffer does not take ownership of contents, and JS_DetachArrayBuffer must be called before the contents are disposed of. |
JS_NewArrayObject⚠ | |
JS_NewArrayObject1⚠ | |
JS_NewDataView⚠ |
Create a new DataView using the given ArrayBuffer for storage. The given buffer must be an ArrayBuffer (or a cross-compartment wrapper of an ArrayBuffer), and the offset and length must fit within the bounds of the arrayBuffer. 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_NewDateObject⚠ | |
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_NewExternalString⚠ |
Create a new JSString whose chars member refers to external memory, i.e., memory requiring application-specific finalization. |
JS_NewFloat32Array⚠ | |
JS_NewFloat32ArrayFromArray⚠ | |
JS_NewFloat32ArrayWithBuffer⚠ | |
JS_NewFloat64Array⚠ | |
JS_NewFloat64ArrayFromArray⚠ | |
JS_NewFloat64ArrayWithBuffer⚠ | |
JS_NewFunction⚠ | |
JS_NewGlobalObject⚠ | |
JS_NewInt16Array⚠ | |
JS_NewInt16ArrayFromArray⚠ | |
JS_NewInt16ArrayWithBuffer⚠ | |
JS_NewInt32Array⚠ | |
JS_NewInt32ArrayFromArray⚠ | |
JS_NewInt32ArrayWithBuffer⚠ | |
JS_NewInt8Array⚠ | |
JS_NewInt8ArrayFromArray⚠ | |
JS_NewInt8ArrayWithBuffer⚠ | |
JS_NewMappedArrayBufferWithContents⚠ |
Create a new mapped array buffer 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 array buffer. |
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 |
JS_NewObjectWithUniqueType⚠ | |
JS_NewObjectWithoutMetadata⚠ |
Allocate an object in exactly the same way as JS_NewObjectWithGivenProto, but without invoking the metadata callback on it. This allows creation of internal bookkeeping objects that are guaranteed to not have metadata attached to them. |
JS_NewPlainObject⚠ |
Creates a new plain object, like |
JS_NewRegExpObject⚠ | |
JS_NewRuntime⚠ | |
JS_NewSharedArrayBuffer⚠ |
Create a new SharedArrayBuffer with the given byte length. This may only be called if JS::CompartmentCreationOptionsRef(cx).getSharedMemoryAndAtomicsEnabled() is true. |
JS_NewStringCopyN⚠ | |
JS_NewStringCopyZ⚠ | |
JS_NewUCRegExpObject⚠ | |
JS_NewUCString⚠ | |
JS_NewUCStringCopyN⚠ | |
JS_NewUCStringCopyZ⚠ | |
JS_NewUint16Array⚠ | |
JS_NewUint16ArrayFromArray⚠ | |
JS_NewUint16ArrayWithBuffer⚠ | |
JS_NewUint32Array⚠ | |
JS_NewUint32ArrayFromArray⚠ | |
JS_NewUint32ArrayWithBuffer⚠ | |
JS_NewUint8Array⚠ | |
JS_NewUint8ArrayFromArray⚠ | |
JS_NewUint8ArrayWithBuffer⚠ | |
JS_NewUint8ClampedArray⚠ | |
JS_NewUint8ClampedArrayFromArray⚠ | |
JS_NewUint8ClampedArrayWithBuffer⚠ | |
JS_NondeterministicGetWeakMapKeys⚠ | |
JS_NondeterministicGetWeakSetKeys⚠ | |
JS_Now⚠ |
Microseconds since the epoch, midnight, January 1, 1970 UTC. |
JS_ObjectCountDynamicSlots⚠ | |
JS_ObjectIsDate⚠ |
Returns true and sets |*isDate| indicating whether |obj| is a Date object or a wrapper around one, otherwise returns false on failure. |
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_ObjectIsRegExp⚠ |
Returns true and sets |*isRegExp| indicating whether |obj| is a RegExp object or a wrapper around one, otherwise returns false on failure. |
JS_ObjectNotWritten⚠ | |
JS_PCToLineNumber⚠ | |
JS_ParseJSON⚠ |
JSON.parse as specified by ES5. |
JS_ParseJSON1⚠ | |
JS_ParseJSONWithReviver⚠ | |
JS_ParseJSONWithReviver1⚠ | |
JS_PreventExtensions⚠ |
Attempt to make |obj| non-extensible. |
JS_PropertyStub⚠ | |
JS_PutEscapedFlatString⚠ | |
JS_PutEscapedString⚠ | |
JS_ReadBytes⚠ | |
JS_ReadStructuredClone⚠ |
Note: if the *data contains transferable objects, it can be read only once. |
JS_ReadTypedArray⚠ | |
JS_ReadUint32Pair⚠ | |
JS_RefreshCrossCompartmentWrappers⚠ | |
JS_ReleaseMappedArrayBufferContents⚠ |
Release the allocated resource of mapped array buffer 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. |
JS_RemoveExtraGCRootsTracer⚠ |
Undo a call to JS_AddExtraGCRootsTracer. |
JS_RemoveFinalizeCallback⚠ | |
JS_RemoveWeakPointerCompartmentCallback⚠ | |
JS_RemoveWeakPointerZoneGroupCallback⚠ | |
JS_ReportAllocationOverflow⚠ |
Complain when an allocation size overflows the maximum supported limit. |
JS_ReportError⚠ |
Report an exception represented by the sprintf-like conversion of format and its arguments. |
JS_ReportErrorFlagsAndNumber⚠ | |
JS_ReportErrorFlagsAndNumberUC⚠ | |
JS_ReportErrorNumber⚠ | |
JS_ReportErrorNumberUC⚠ | |
JS_ReportErrorNumberUCArray⚠ | |
JS_ReportOutOfMemory⚠ |
Complain when out of memory. |
JS_ReportWarning⚠ |
As above, but report a warning instead (JSREPORT_IS_WARNING(report.flags)). Return true if there was no error trying to issue the warning, and if the warning was not converted into an error due to the JSOPTION_WERROR option being set, false otherwise. |
JS_RequestInterruptCallback⚠ | |
JS_ResetDefaultLocale⚠ |
Reset the default locale to OS defaults. |
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_RestoreExceptionState⚠ | |
JS_SameValue⚠ | |
JS_SaveExceptionState⚠ | |
JS_ScriptHasMutedErrors⚠ | |
JS_SetAccumulateTelemetryCallback⚠ | |
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_SetArrayLength⚠ | |
JS_SetCompartmentNameCallback⚠ | |
JS_SetCompartmentPrincipals⚠ | |
JS_SetCompartmentPrivate⚠ | |
JS_SetCurrentEmbedderTimeFunction⚠ |
The embedding can specify a time function that will be used in some situations. The function can return the time however it likes; but the norm is to return times in units of milliseconds since an arbitrary, but consistent, epoch. If the time function is not set, a built-in default will be used. |
JS_SetDefaultLocale⚠ |
The default locale for the ECMAScript Internationalization API (Intl.Collator, Intl.NumberFormat, Intl.DateTimeFormat). Note that the Internationalization API encourages clients to specify their own locales. The locale string remains owned by the caller. |
JS_SetDestroyCompartmentCallback⚠ | |
JS_SetDestroyZoneCallback⚠ | |
JS_SetElement⚠ | |
JS_SetElement1⚠ | |
JS_SetElement2⚠ | |
JS_SetElement3⚠ | |
JS_SetElement4⚠ | |
JS_SetElement5⚠ | |
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_SetInterruptCallback⚠ | |
JS_SetLocaleCallbacks⚠ |
Establish locale callbacks. The pointer must persist as long as the JSRuntime. Passing nullptr restores the default behaviour. |
JS_SetNativeStackQuota⚠ |
Set the size of the native stack that should not be exceed. To disable stack size checking pass 0. |
JS_SetObjectsTenuredCallback⚠ | |
JS_SetOffthreadIonCompilationEnabled⚠ | |
JS_SetParallelParsingEnabled⚠ | |
JS_SetPendingException⚠ | |
JS_SetPrivate⚠ | |
JS_SetProperty⚠ | |
JS_SetPropertyById⚠ |
Perform the assignment |
JS_SetProtoCalled⚠ | |
JS_SetPrototype⚠ |
Change the prototype of obj. |
JS_SetRegExpInput⚠ | |
JS_SetReservedSlot⚠ | |
JS_SetRuntimePrivate⚠ | |
JS_SetSecurityCallbacks⚠ | |
JS_SetSizeOfIncludingThisCompartmentCallback⚠ | |
JS_SetSweepZoneCallback⚠ | |
JS_SetTrustedPrincipals⚠ | |
JS_SetUCProperty⚠ | |
JS_SetVersionForCompartment⚠ |
Mutate the version on the compartment. This is generally discouraged, but necessary to support the version mutation in the js and xpc shell command set. |
JS_SetWrapObjectCallbacks⚠ | |
JS_SetZoneUserData⚠ | |
JS_ShutDown⚠ |
Destroy free-standing resources allocated by SpiderMonkey, not associated with any runtime, context, or other structure. |
JS_SplicePrototype⚠ | |
JS_StealArrayBufferContents⚠ |
Steal the contents of the given array buffer. The array buffer 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. |
JS_StrictPropertyStub⚠ | |
JS_StrictlyEqual⚠ | |
JS_StringEqualsAscii⚠ | |
JS_StringHasBeenPinned⚠ | |
JS_StringHasLatin1Chars⚠ |
Returns true iff the string's characters are stored as Latin1. |
JS_StringIsFlat⚠ | |
JS_StringToId⚠ | |
JS_StringToVersion⚠ | |
JS_Stringify⚠ |
JSON.stringify as specified by ES5. |
JS_StructuredClone⚠ | |
JS_StructuredCloneHasTransferables⚠ | |
JS_ThrowStopIteration⚠ | |
JS_TraceObjectGroupCycleCollectorChildren⚠ | |
JS_TraceShapeCycleCollectorChildren⚠ | |
JS_TransplantObject⚠ | |
JS_TypeOfValue⚠ | |
JS_UpdateWeakPointerAfterGC⚠ | |
JS_UpdateWeakPointerAfterGCUnbarriered⚠ | |
JS_ValueToConstructor⚠ | |
JS_ValueToFunction⚠ | |
JS_ValueToId⚠ | |
JS_ValueToObject⚠ | |
JS_ValueToSource⚠ | |
JS_VersionToString⚠ | |
JS_WrapObject⚠ | |
JS_WrapPropertyDescriptor⚠ | |
JS_WrapValue⚠ | |
JS_WriteBytes⚠ | |
JS_WriteString⚠ | |
JS_WriteStructuredClone⚠ |
Note: On success, the caller is responsible for calling JS_ClearStructuredClone(*datap, nbytes, optionalCallbacks, closure). |
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_freeop⚠ |
A wrapper for js_free(p) that may delay js_free(p) invocation as a performance optimization as specified by the given JSFreeOp instance. |
JS_malloc⚠ | |
JS_realloc⚠ | |
JS_strdup⚠ | |
JS_strdup1⚠ |
Duplicate a string. Does not report an error on failure. |
JS_updateMallocCounter⚠ | |
MapClear⚠ | |
MapDelete⚠ | |
MapEntries⚠ | |
MapForEach⚠ | |
MapGet⚠ | |
MapHas⚠ | |
MapKeys⚠ | |
MapSet⚠ | |
MapSize⚠ | |
MapValues⚠ | |
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. |
ModuleDeclarationInstantiation⚠ | |
ModuleEvaluation⚠ | |
NewAddonId⚠ | |
NewFunctionByIdWithReserved⚠ | |
NewFunctionFromSpec⚠ |
Create a new function based on the given JSFunctionSpec, *fs.
id is the result of a successful call to
|
NewFunctionWithReserved⚠ | |
NewMapObject⚠ | |
NewMemoryInfoObject⚠ |
Create an object providing access to the garbage collector's internal notion of the current state of memory (both GC heap memory and GCthing-controlled malloc memory. |
NewPromiseObject⚠ |
Returns a new instance of the Promise builtin class in the current
compartment, with the right slot layout. If a |
NewSetObject⚠ | |
NewSymbol⚠ |
Create a new Symbol with the given description. This function never returns a Symbol that is in the Runtime-wide symbol registry. |
NewWeakMapObject⚠ | |
NotifyAnimationActivity⚠ | |
NotifyDidPaint⚠ | |
NukeCrossCompartmentWrappers⚠ | |
ObjectClassName⚠ | |
ObjectToCompletePropertyDescriptor⚠ | |
OrdinaryToPrimitive⚠ |
ES6 draft 20141224, 7.1.1, second algorithm. |
PeakSizeOfTemporary⚠ | |
PokeGC⚠ | |
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. |
PropertySpecNameEqualsId⚠ | |
PropertySpecNameToPermanentId⚠ |
Create a jsid that does not need to be marked for GC. |
ProtoKeyToClass⚠ | |
ProtoKeyToId⚠ | |
PurgePCCounts⚠ | |
RegExpToSharedNonInline⚠ | |
RejectPromise⚠ |
Rejects the given |
RemoveRawValueRoot⚠ | |
ReportErrorWithId⚠ | |
ReportIsNotFunction⚠ | |
ReportOutOfMemory⚠ | |
ReportOverRecursed⚠ | |
ResetPerformanceMonitoring⚠ |
Cancel any measurement that hasn't been committed. |
ResolvePromise⚠ |
Resolves the given Promise with the given |
RunningWithTrustedPrincipals⚠ | |
RuntimeOptionsRef⚠ | |
RuntimeOptionsRef1⚠ | |
SetActivityCallback⚠ |
Sets a callback that is run whenever the runtime goes idle - the last active request ceases - and begins activity - when it was idle and a request begins. |
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. |
SetAsmJSCacheOps⚠ | |
SetBuildIdOp⚠ | |
SetCTypesActivityCallback⚠ |
Sets a callback that is run whenever js-ctypes is about to be used when calling into C. |
SetClear⚠ | |
SetDOMCallbacks⚠ | |
SetDOMProxyInformation⚠ | |
SetDelete⚠ | |
SetEnqueuePromiseJobCallback⚠ |
Sets the callback that's invoked whenever a Promise job should be enqeued. |
SetEntries⚠ | |
SetForEach⚠ | |
SetFunctionNativeReserved⚠ | |
SetGCNurseryCollectionCallback⚠ |
Set the nursery collection callback for the given runtime. When set, it will be called at the start and end of every nursery collection. |
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⚠ | |
SetKeys⚠ | |
SetLargeAllocationFailureCallback⚠ | |
SetModuleHostDefinedField⚠ |
Set the [[HostDefined]] field of a source text module record to the given value. |
SetModuleResolveHook⚠ |
Set the HostResolveImportedModule hook for a global to the given function. |
SetOutOfMemoryCallback⚠ | |
SetPreserveWrapperCallback⚠ | |
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. |
SetPropertyIgnoringNamedGetter⚠ |
Helper function for HTMLDocument and HTMLFormElement. |
SetReservedOrProxyPrivateSlotWithBarrier⚠ | |
SetScriptEnvironmentPreparer⚠ | |
SetSize⚠ | |
SetStopwatchIsMonitoringCPOW⚠ |
Turn on/off stopwatch-based CPU monitoring. |
SetStopwatchIsMonitoringJank⚠ | |
SetStopwatchStartCallback⚠ | |
SetValues⚠ | |
SetWarningReporter⚠ | |
SetWeakMapEntry⚠ | |
SetWindowProxy⚠ |
Associates a WindowProxy with a Window (global object). |
SetWindowProxyClass⚠ |
Tell the JS engine which Class is used for WindowProxy objects. Used by the functions below. |
ShrinkGCBuffers⚠ |
The GC does not immediately return the unused memory freed by a collection back to the system incase it is needed soon afterwards. This call forces the GC to return this memory immediately. |
SkipZoneForGC⚠ |
Undoes the effect of the Prepare methods above. The given zone will not be collected in the next GC. |
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(rt). |
StartPCCountProfiling⚠ | |
StopPCCountProfiling⚠ | |
StringIsArrayIndex⚠ | |
StringOfAddonId⚠ | |
StringToLinearStringSlow⚠ | |
SystemCompartmentCount⚠ | |
ToBooleanSlow⚠ | |
ToInt16Slow⚠ | |
ToInt32Slow⚠ | |
ToInt64Slow⚠ | |
ToInt8Slow⚠ | |
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. |
ToStringSlow⚠ | |
ToUint16Slow⚠ | |
ToUint32Slow⚠ | |
ToUint64Slow⚠ | |
ToUint8Slow⚠ | |
ToWindowIfWindowProxy⚠ |
If |
ToWindowProxyIfWindow⚠ |
If |
TraceChildren⚠ | |
TraceEdge⚠ | |
TraceWeakMaps⚠ | |
Unbox⚠ | |
UnhideScriptedCaller⚠ | |
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. |
UnwatchGuts⚠ |
Remove a watchpoint -- in the Object.prototype.watch sense -- from |obj| for the property |id|. |
UnwrapArrayBuffer⚠ | |
UnwrapArrayBufferView⚠ | |
UnwrapFloat32Array⚠ | |
UnwrapFloat64Array⚠ | |
UnwrapInt16Array⚠ | |
UnwrapInt32Array⚠ | |
UnwrapInt8Array⚠ | |
UnwrapSharedArrayBuffer⚠ | |
UnwrapUint16Array⚠ | |
UnwrapUint32Array⚠ | |
UnwrapUint8Array⚠ | |
UnwrapUint8ClampedArray⚠ | |
UserCompartmentCount⚠ | |
VisitGrayWrapperTargets⚠ | |
WasIncrementalGC⚠ |
Returns true if the most recent GC ran incrementally. |
WatchGuts⚠ |
Add a watchpoint -- in the Object.prototype.watch sense -- to |obj| for the property |id|, using the callable object |callable| as the function to be called for notifications. |
ZoneGlobalsAreAllGray⚠ | |
isGCEnabled⚠ | |
obj_defineGetter⚠ | |
obj_defineSetter⚠ | |
proxy_Call⚠ | |
proxy_Construct⚠ | |
proxy_Convert⚠ | |
proxy_DefineProperty⚠ | |
proxy_DeleteProperty⚠ | |
proxy_Finalize⚠ | |
proxy_FunToString⚠ | |
proxy_GetElements⚠ | |
proxy_GetOwnPropertyDescriptor⚠ | |
proxy_GetProperty⚠ | |
proxy_HasInstance⚠ | |
proxy_HasProperty⚠ | |
proxy_LookupProperty⚠ | |
proxy_ObjectMoved⚠ | |
proxy_SetProperty⚠ | |
proxy_Trace⚠ | |
proxy_Unwatch⚠ | |
proxy_Watch⚠ | |
proxy_WeakmapKeyDelegate⚠ | |
proxy_innerObject⚠ |
Type Definitions
ActivityCallback | |
AutoIdVector | |
AutoObjectVector | |
AutoValueVector | |
BuildIdCharVector | |
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. |
CTypesActivityCallback | |
ClassObjectCreationOp |
Callback for the creation of constructor and prototype objects. |
CloseAsmJSCacheEntryForReadOp | |
CloseAsmJSCacheEntryForWriteOp | |
CompartmentStatsVector | |
DOMCallbacks | |
DOMInstanceClassHasProtoAtDepth | |
DOMProxyShadowsCheck | |
DefinePropertyOp | |
DeletePropertyOp | |
DumpHeapNurseryBehaviour | |
FinalizeOp | |
FinishClassInitOp |
Callback for custom post-processing after class initialization via ClassSpec. |
FreeTransferStructuredCloneOp |
Called when JS_ClearStructuredClone has to free an unknown transferable object. Note that it should never trigger a garbage collection (and will assert in a debug build if it does.) |
GCNurseryCollectionCallback |
A nursery collection callback receives the progress of the nursery collection and the reason for the collection. |
GCSliceCallback | |
GCThingCallback | |
Generation | |
GetElementsOp | |
GetOwnPropertyOp | |
GetPropertyOp | |
HandleFunction | |
HandleId | |
HandleObject | |
HandleScript | |
HandleString | |
HandleSymbol | |
HandleValue | |
HasPropertyOp | |
HashNumber | |
IdVector | |
IsAcceptableThis | |
JSAccumulateTelemetryDataCallback | |
JSAddPropertyOp |
Add a property named by id to obj. |
JSCSPEvalChecker | |
JSCallOnceType | |
JSClassInternal | |
JSCompartmentNameCallback | |
JSConstDoubleSpec | |
JSConstIntegerSpec | |
JSDeletePropertyOp |
Delete a property named by id in obj. |
JSDestroyCompartmentCallback | |
JSDestroyPrincipalsOp | |
JSEnqueuePromiseJobCallback | |
JSEnumerateOp |
The old-style JSClass.enumerate op should define all lazy properties not yet reflected in obj. |
JSErrorCallback | |
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. |
JSGCCallback | |
JSGetterOp |
Get a property named by id in obj. Note the jsid id type -- id may be a string (Unicode property identifier) or an int (element index). The *vp out parameter, on success, is the new property value after the action. |
JSHasInstanceOp |
Check whether v is an instance of obj. Return false on error or exception, true on success with true in *bp if v is an instance of obj, false in *bp otherwise. |
JSInitCallback | |
JSInterruptCallback | |
JSIterateCompartmentCallback | |
JSJitGetterOp | |
JSJitMethodOp | |
JSJitSetterOp | |
JSLocaleCompare | |
JSLocaleToLowerCase | |
JSLocaleToUnicode | |
JSLocaleToUpperCase | |
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. |
JSProcessPromiseCallback | |
JSPromiseRejectionTrackerCallback | |
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. |
JSSetterOp |
Set a property named by id in obj, treating the assignment as strict mode code if strict is true. Note the jsid id type -- id may be a string (Unicode property identifier) or an int (element index). The *vp out parameter, on success, is the new property value after the set. |
JSSizeOfIncludingThisCompartmentCallback | |
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 one of the JS_Call*Tracer variants on the thing. |
JSWeakPointerCompartmentCallback | |
JSWeakPointerZoneGroupCallback | |
JSWeakmapKeyDelegateOp | |
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. |
JSZoneCallback | |
JS_CurrentEmbedderTimeFunction | |
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.) |
Latin1Char | |
LookupPropertyOp | |
MallocSizeOf | |
MozMallocSizeOf | |
MutableHandleFunction | |
MutableHandleId | |
MutableHandleObject | |
MutableHandleScript | |
MutableHandleString | |
MutableHandleSymbol | |
MutableHandleValue | |
NativeImpl | |
OffThreadCompileCallback | |
OpenAsmJSCacheEntryForReadOp | |
OpenAsmJSCacheEntryForWriteOp | |
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. |
PersistentRootedFunction | |
PersistentRootedId | |
PersistentRootedObject | |
PersistentRootedScript | |
PersistentRootedString | |
PersistentRootedSymbol | |
PersistentRootedValue | |
PreserveWrapperCallback | |
PropertyCopyBehavior | |
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. |
RootedFunction | |
RootedId | |
RootedListHeads | |
RootedObject | |
RootedScript | |
RootedString | |
RootedSymbol | |
RootedValue | |
ScriptVector | |
SetPropertyOp | |
StopwatchStartCallback | |
StringVector | |
StructuredCloneErrorOp |
This is called when JS_WriteStructuredClone is given an invalid transferable. To follow HTML5, the application must throw a DATA_CLONE_ERR DOMException with error set to one of the JS_SCERR_* values. |
TransferStructuredCloneOp |
Called when JS_WriteStructuredClone receives a transferable object not handled by the engine. If this hook does not exist or returns false, the JS engine will call the reportError hook or fall back to throwing a DATA_CLONE_ERR DOM Exception. This method is called before any other callback. |
UnwatchOp | |
ValueVector | |
WarningReporter | |
WatchOp | |
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 | |
jsbytecode |