JSAPI Reference

  • Revision slug: SpiderMonkey/JSAPI_Reference/JSAPI_Reference
  • Revision title: JSAPI Reference
  • Revision id: 147934
  • Created:
  • Creator: Jorend
  • Is current revision? No
  • Comment /* Security */ +[[JSAccessMode]]

Revision Content

The JSAPI is the C API for the SpiderMonkey JavaScript engine. To learn how to use the JSAPI, see Embedding SpiderMonkey and the JSAPI Phrasebook.


Alphabetical List

Functions

Runtimes and contexts

Locale callbacks:

Locale callback types:

Scripts

Just running some JavaScript code is straightforward:

You can instead compile JavaScript code into a JSScript which you can then execute multiple times.

You can also compile JavaScript code into a function:

Error handling

The following functions allow C/C++ functions to throw and catch JavaScript exceptions:

These functions translate errors into exceptions and vice versa:

Values and types

jsval constants:

Function and macros for checking the type of a jsval:

An enumeration of all the JavaScript types:

High-level type-conversion routines for packing and unpacking function arguments.

The following functions convert JS values to various types. They can be safely applied to jsvals of any type. They may return new objects. For example, JS_ValueToObject(cx, s) where s is a string creates a new String wrapper object. These functions may call JavaScript methods. For example, JS_ValueToString(cx, obj) may call obj.toString().

Fast, unchecked type-casting macros. These macros must not be applied to values that are not known to be the right type. Like C casts, they may cause crashes if applied to incorrect values. They never create new objects or call into JavaScript code.

And:

Memory management

These functions act like the Standard C malloc family of functions, except that errors are reported using the SpiderMonkey error APIs rather than errno:

JavaScript objects, strings, and floating-point numbers are garbage collected. These functions provide access to the garbage collector:

The rest of these APIs help protect objects from being destroyed by the garbage collector before the application is done using them.

If a variable is a root, then anything it points to will not be freed by the garbage collector. Failure to root objects is a very common cause of mysterious crashes.

Local root scopes are another way of protecting objects from the garbage collector.

{{template.Jsapi_minversion_inline("1.8 (not yet released)")}} If an object contains references to other GC things that are not stored in SpiderMonkey data structures ("slots"), it must implement the JSTraceOp hook to enable the garbage collector to traverse those references. Otherwise the garbage collector will not find all reachable objects and may collect objects that are still reachable, leading to a crash. (In SpiderMonkey 1.7 and earlier, the JSMarkOp hook is used instead. This will be deprecated when SpiderMonkey 1.8 is released.)

The tracing APIs are used by the garbage collector and JSTraceOp hooks. JSAPI applications may also use them to examine the object graph. (For example, these APIs support very smooth integration between the JS garbage collector and other garbage collectors.)

Miscellaneous GC APIs:

Numbers

Strings

Interning strings tells the SpiderMonkey engine to reuse existing string objects when possible.

The character data for external strings is stored in memory provided by the application. Applications can use this to avoid copying data back and forth between SpiderMonkey's heap and application memory.

Objects

Properties

A SpiderMonkey extension allows a native function to return an lvalue—that is, a reference to a property of an object:

A jsid is kind of like a jsval, only different. A handful of APIs use jsids instead of jsvals for property names: JS_CheckAccess, JS_Enumerate, JS_GetMethodById, and JS_NextProperty.

Classes

These API features are used to define custom classes—object types that are implemented in C/C++ code but accessible from JavaScript.

Adding native properties and methods to classes:

JSFastNative methods use these macros:

The behavior of a JSClass and its instances can be customized in many ways using callback functions.

JSClass method types:

JSExtendedClass method types:

JSObjectOps method types:

JSXMLObjectOps method types:

These stub functions can be used when creating a custom JSClass:

Arrays

Functions

Calling a function or a method of an object:

Function accessors:

Creating functions:

RegExps

Security

Threading

The following functions support the SpiderMonkey threading model. They are only available in JS_THREADSAFE builds.

The following functions exist in all builds, but in non-JS_THREADSAFE builds, they do nothing:

Time

Callback Types

Native function types:

Other callback types:

See also Classes, above.

Macros


Preprocessor conditionals

{{ wiki.languages( { "ja": "ja/JSAPI_Reference", "pl": "pl/Dokumentacja_JSAPI" } ) }}

Revision Source

<p>
The <b>JSAPI</b> is the C API for the <a href="en/SpiderMonkey">SpiderMonkey</a> JavaScript engine. To learn how to use the JSAPI, see <a href="en/Embedding_SpiderMonkey">Embedding SpiderMonkey</a> and the <a href="en/JSAPI_Phrasebook">JSAPI Phrasebook</a>.
</p><p><br>
<a href="en/JSAPI_Reference/Alphabetical_List">Alphabetical List</a>
</p>
<h3 name="Functions"> Functions </h3>
<h4 name="Runtimes_and_contexts"> Runtimes and contexts </h4>
<ul><li> struct <a href="en/JSRuntime">JSRuntime</a>
</li><li> <a href="en/JS_NewRuntime">JS_NewRuntime</a>
</li><li> <a href="en/JS_DestroyRuntime">JS_DestroyRuntime</a>
</li><li> <a href="en/JS_ShutDown">JS_ShutDown</a>
</li><li> <a href="en/JS_GetRuntimePrivate">JS_GetRuntimePrivate</a>
</li><li> <a href="en/JS_SetRuntimePrivate">JS_SetRuntimePrivate</a>
</li><li> <a href="en/JS_Init">JS_Init</a> {{template.Deprecated_inline()}}
</li><li> <a href="en/JS_Finish">JS_Finish</a> {{template.Deprecated_inline()}}
</li><li> <a href="en/JS_ContextIterator">JS_ContextIterator</a>
</li></ul>
<ul><li> struct <a href="en/JSContext">JSContext</a>
</li><li> <a href="en/JS_NewContext">JS_NewContext</a>
</li><li> <a href="en/JS_DestroyContext">JS_DestroyContext</a>
</li><li> <a href="en/JS_DestroyContextMaybeGC">JS_DestroyContextMaybeGC</a>
</li><li> <a href="en/JS_DestroyContextNoGC">JS_DestroyContextNoGC</a>
</li><li> <a href="en/JS_GetRuntime">JS_GetRuntime</a>
</li><li> <a href="en/JS_GetContextPrivate">JS_GetContextPrivate</a>
</li><li> <a href="en/JS_SetContextPrivate">JS_SetContextPrivate</a>
</li><li> <a href="en/JS_GetOptions">JS_GetOptions</a>
</li><li> <a href="en/JS_SetOptions">JS_SetOptions</a>
</li><li> <a href="en/JS_ToggleOptions">JS_ToggleOptions</a>
</li><li> <a href="en/JS_SetBranchCallback">JS_SetBranchCallback</a>
</li><li> <a href="en/JS_SetOperationCallback">JS_SetOperationCallback</a>, <a href="en/JS_ClearOperationCallback">JS_ClearOperationCallback</a>, <a href="en/JS_GetOperationCallback">JS_GetOperationCallback</a>, <a href="en/JS_GetOperationLimit">JS_GetOperationLimit</a>, <a href="en/JS_SetOperationLimit">JS_SetOperationLimit</a>, <a href="en/JS_MAX_OPERATION_LIMIT">JS_MAX_OPERATION_LIMIT</a>, <a href="en/JS_OPERATION_WEIGHT_BASE">JS_OPERATION_WEIGHT_BASE</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> <a href="en/JS_SetThreadStackLimit">JS_SetThreadStackLimit</a>
</li><li> <a href="en/JS_SetScriptStackQuota">JS_SetScriptStackQuota</a>
</li></ul>
<ul><li> <a href="en/JS_GetImplementationVersion">JS_GetImplementationVersion</a>
</li><li> <a href="en/JS_GetVersion">JS_GetVersion</a>
</li><li> <a href="en/JS_SetVersion">JS_SetVersion</a>
</li><li> <a href="en/JS_StringToVersion">JS_StringToVersion</a>
</li><li> <a href="en/JS_VersionToString">JS_VersionToString</a>
</li></ul>
<ul><li> <a href="en/JS_GetGlobalObject">JS_GetGlobalObject</a>
</li><li> <a href="en/JS_SetGlobalObject">JS_SetGlobalObject</a>
</li><li> <a href="en/JS_InitClass">JS_InitClass</a>
</li><li> <a href="en/JS_InitStandardClasses">JS_InitStandardClasses</a>
</li><li> <a href="en/JS_ResolveStandardClass">JS_ResolveStandardClass</a>
</li><li> <a href="en/JS_EnumerateStandardClasses">JS_EnumerateStandardClasses</a>
</li><li> <a href="en/JS_EnumerateResolvedStandardClasses">JS_EnumerateResolvedStandardClasses</a>
</li></ul>
<ul><li> <a href="en/JS_IsAssigning">JS_IsAssigning</a>
</li><li> <a href="en/JS_IsConstructing">JS_IsConstructing</a>
</li><li> <a href="en/JS_IsRunning">JS_IsRunning</a>
</li><li> <a href="en/JS_GetScopeChain">JS_GetScopeChain</a>
</li><li> <a href="en/JS_SaveFrameChain">JS_SaveFrameChain</a>, <a href="en/JS_RestoreFrameChain">JS_RestoreFrameChain</a>
</li></ul>
<p>Locale callbacks:
</p>
<ul><li> struct <a href="en/JSLocaleCallbacks">JSLocaleCallbacks</a>
</li><li> <a href="en/JS_GetLocaleCallbacks">JS_GetLocaleCallbacks</a>
</li><li> <a href="en/JS_SetLocaleCallbacks">JS_SetLocaleCallbacks</a>
</li></ul>
<p>Locale callback types:
</p>
<ul><li> <a href="en/JSLocaleToUpperCase">JSLocaleToUpperCase</a>
</li><li> <a href="en/JSLocaleToLowerCase">JSLocaleToLowerCase</a>
</li><li> <a href="en/JSLocaleCompare">JSLocaleCompare</a>
</li><li> <a href="en/JSLocaleToUnicode">JSLocaleToUnicode</a>
</li><li> <a href="en/JSErrorCallback">JSErrorCallback</a>
</li></ul>
<h4 name="Scripts"> Scripts </h4>
<p>Just running some JavaScript code is straightforward:
</p>
<ul><li> <a href="en/JS_EvaluateScript">JS_EvaluateScript</a>
</li><li> <a href="en/JS_EvaluateUCScript">JS_EvaluateUCScript</a>
</li><li> <a href="en/JS_EvaluateScriptForPrincipals">JS_EvaluateScriptForPrincipals</a>
</li><li> <a href="en/JS_EvaluateUCScriptForPrincipals">JS_EvaluateUCScriptForPrincipals</a>
</li></ul>
<p>You can instead compile JavaScript code into a <code>JSScript</code> which you can then execute multiple times.
</p>
<ul><li> <a href="en/JS_CompileFile">JS_CompileFile</a>
</li><li> <a href="en/JS_CompileFileHandle">JS_CompileFileHandle</a>
</li><li> <a href="en/JS_CompileFileHandleForPrincipals">JS_CompileFileHandleForPrincipals</a>
</li><li> <a href="en/JS_CompileScript">JS_CompileScript</a>
</li><li> <a href="en/JS_CompileUCScript">JS_CompileUCScript</a>
</li><li> <a href="en/JS_CompileScriptForPrincipals">JS_CompileScriptForPrincipals</a>
</li><li> <a href="en/JS_CompileUCScriptForPrincipals">JS_CompileUCScriptForPrincipals</a>
</li><li> <a href="en/JS_BufferIsCompilableUnit">JS_BufferIsCompilableUnit</a>
</li><li> <a href="en/JS_GetScriptObject">JS_GetScriptObject</a>
</li><li> <a href="en/JS_NewScriptObject">JS_NewScriptObject</a>
</li><li> <a href="en/JS_ExecuteScript">JS_ExecuteScript</a>
</li><li> <a href="en/JS_ExecuteScriptPart">JS_ExecuteScriptPart</a>
</li><li> <a href="en/JS_DecompileScript">JS_DecompileScript</a>
</li><li> <a href="en/JS_DestroyScript">JS_DestroyScript</a>
</li></ul>
<p>You can also compile JavaScript code into a function:
</p>
<ul><li> <a href="en/JS_CompileFunction">JS_CompileFunction</a>
</li><li> <a href="en/JS_CompileFunctionForPrincipals">JS_CompileFunctionForPrincipals</a>
</li><li> <a href="en/JS_CompileUCFunction">JS_CompileUCFunction</a>
</li><li> <a href="en/JS_CompileUCFunctionForPrincipals">JS_CompileUCFunctionForPrincipals</a>
</li><li> <a href="en/JS_DecompileFunction">JS_DecompileFunction</a>
</li><li> <a href="en/JS_DecompileFunctionBody">JS_DecompileFunctionBody</a>
</li></ul>
<h4 name="Error_handling"> Error handling </h4>
<ul><li> struct <a href="en/JSErrorReport">JSErrorReport</a>
</li><li> <a href="en/JS_ReportError">JS_ReportError</a>
</li><li> <a href="en/JS_ReportWarning">JS_ReportWarning</a>
</li><li> <a href="en/JS_ReportErrorNumber">JS_ReportErrorNumber</a>, <a href="en/JS_ReportErrorNumberUC">JS_ReportErrorNumberUC</a>, <a href="en/JS_ReportErrorFlagsAndNumber">JS_ReportErrorFlagsAndNumber</a>, <a href="en/JS_ReportErrorFlagsAndNumberUC">JS_ReportErrorFlagsAndNumberUC</a>
</li><li> <a href="en/JS_ReportOutOfMemory">JS_ReportOutOfMemory</a>
</li><li> <a href="en/JS_SetErrorReporter">JS_SetErrorReporter</a>
</li><li> <a href="en/JSREPORT_IS_EXCEPTION">JSREPORT_IS_EXCEPTION</a>
</li><li> <a href="en/JSREPORT_IS_STRICT">JSREPORT_IS_STRICT</a>
</li><li> <a href="en/JSREPORT_IS_WARNING">JSREPORT_IS_WARNING</a>
</li></ul>
<p>The following functions allow C/C++ functions to throw and catch JavaScript exceptions:
</p>
<ul><li> <a href="en/JS_IsExceptionPending">JS_IsExceptionPending</a>
</li><li> <a href="en/JS_GetPendingException">JS_GetPendingException</a>
</li><li> <a href="en/JS_SetPendingException">JS_SetPendingException</a>
</li><li> <a href="en/JS_ClearPendingException">JS_ClearPendingException</a>
</li><li> <a href="en/JS_ThrowStopIteration">JS_ThrowStopIteration</a>
</li></ul>
<ul><li> struct <a href="en/JSExceptionState">JSExceptionState</a>
</li><li> <a href="en/JS_SaveExceptionState">JS_SaveExceptionState</a>
</li><li> <a href="en/JS_RestoreExceptionState">JS_RestoreExceptionState</a>
</li><li> <a href="en/JS_DropExceptionState">JS_DropExceptionState</a>
</li></ul>
<p>These functions translate errors into exceptions and vice versa:
</p>
<ul><li> <a href="en/JS_ReportPendingException">JS_ReportPendingException</a>
</li><li> <a href="en/JS_ErrorFromException">JS_ErrorFromException</a>
</li><li> <a href="en/JS_ThrowReportedError">JS_ThrowReportedError</a>
</li></ul>
<h4 name="Values_and_types"> Values and types </h4>
<p><code><a href="en/Jsval">jsval</a></code> constants:
</p>
<ul><li> <a href="en/JSVAL_NULL">JSVAL_NULL</a>
</li><li> <a href="en/JSVAL_VOID">JSVAL_VOID</a>
</li><li> <a href="en/JSVAL_TRUE">JSVAL_TRUE</a>
</li><li> <a href="en/JSVAL_FALSE">JSVAL_FALSE</a>
</li><li> <a href="en/JSVAL_ZERO">JSVAL_ZERO</a>
</li><li> <a href="en/JSVAL_ONE">JSVAL_ONE</a>
</li></ul>
<p>Function and macros for checking the type of a <code>jsval</code>:
</p>
<ul><li> <a href="en/JS_TypeOfValue">JS_TypeOfValue</a>
</li><li> <a href="en/JSVAL_IS_NULL">JSVAL_IS_NULL</a>
</li><li> <a href="en/JSVAL_IS_VOID">JSVAL_IS_VOID</a>
</li><li> <a href="en/JSVAL_IS_BOOLEAN">JSVAL_IS_BOOLEAN</a>
</li><li> <a href="en/JSVAL_IS_NUMBER">JSVAL_IS_NUMBER</a>
</li><li> <a href="en/JSVAL_IS_INT">JSVAL_IS_INT</a>
</li><li> <a href="en/JSVAL_IS_DOUBLE">JSVAL_IS_DOUBLE</a>
</li><li> <a href="en/JSVAL_IS_STRING">JSVAL_IS_STRING</a>
</li><li> <a href="en/JSVAL_IS_OBJECT">JSVAL_IS_OBJECT</a>
</li><li> <a href="en/JSVAL_IS_PRIMITIVE">JSVAL_IS_PRIMITIVE</a>
</li><li> <a href="en/JSVAL_IS_GCTHING">JSVAL_IS_GCTHING</a>
</li></ul>
<p>An enumeration of all the JavaScript types:
</p>
<ul><li> <a href="en/JSType">JSType</a>
</li></ul>
<p>High-level type-conversion routines for packing and unpacking function arguments.
</p>
<ul><li> <a href="en/JS_PushArguments">JS_PushArguments</a>
</li><li> <a href="en/JS_PushArgumentsVA">JS_PushArgumentsVA</a>
</li><li> <a href="en/JS_PopArguments">JS_PopArguments</a>
</li></ul>
<ul><li> <a href="en/JS_ConvertArguments">JS_ConvertArguments</a>
</li><li> <a href="en/JS_ConvertArgumentsVA">JS_ConvertArgumentsVA</a>
</li><li> <a href="en/JS_AddArgumentFormatter">JS_AddArgumentFormatter</a>, <a href="en/JS_RemoveArgumentFormatter">JS_RemoveArgumentFormatter</a>
</li></ul>
<p>The following functions convert JS values to various types.  They can be safely applied to <code>jsval</code>s of any type.  They may return new objects.  For example, <code>JS_ValueToObject(cx, s)</code> where <code>s</code> is a string creates a new <code>String</code> wrapper object.  These functions may call JavaScript methods.  For example, <code>JS_ValueToString(cx, obj)</code> may call <code>obj.toString()</code>.
</p>
<ul><li> <a href="en/JS_ValueToBoolean">JS_ValueToBoolean</a>
</li><li> <a href="en/JS_ValueToConstructor">JS_ValueToConstructor</a>
</li><li> <a href="en/JS_ValueToECMAInt32">JS_ValueToECMAInt32</a>
</li><li> <a href="en/JS_ValueToECMAUint32">JS_ValueToECMAUint32</a>
</li><li> <a href="en/JS_ValueToFunction">JS_ValueToFunction</a>
</li><li> <a href="en/JS_ValueToInt32">JS_ValueToInt32</a>
</li><li> <a href="en/JS_ValueToNumber">JS_ValueToNumber</a>
</li><li> <a href="en/JS_ValueToObject">JS_ValueToObject</a>
</li><li> <a href="en/JS_ValueToString">JS_ValueToString</a>
</li><li> <a href="en/JS_ValueToUint16">JS_ValueToUint16</a>
</li><li> <a href="en/JS_ConvertValue">JS_ConvertValue</a>
</li></ul>
<p>Fast, unchecked type-casting macros.  These macros must not be applied to values that are not known to be the right type.  Like C casts, they may cause crashes if applied to incorrect values.  They never create new objects or call into JavaScript code.
</p>
<ul><li> <a href="en/JSVAL_TO_BOOLEAN">JSVAL_TO_BOOLEAN</a>, <a href="en/BOOLEAN_TO_JSVAL">BOOLEAN_TO_JSVAL</a>
</li><li> <a href="en/JSVAL_TO_INT">JSVAL_TO_INT</a>, <a href="en/INT_TO_JSVAL">INT_TO_JSVAL</a>, <a href="en/INT_FITS_IN_JSVAL">INT_FITS_IN_JSVAL</a>
</li><li> <a href="en/JSVAL_TO_DOUBLE">JSVAL_TO_DOUBLE</a>, <a href="en/DOUBLE_TO_JSVAL">DOUBLE_TO_JSVAL</a>
</li><li> <a href="en/JSVAL_TO_OBJECT">JSVAL_TO_OBJECT</a>, <a href="en/OBJECT_TO_JSVAL">OBJECT_TO_JSVAL</a>
</li><li> <a href="en/JSVAL_TO_STRING">JSVAL_TO_STRING</a>, <a href="en/STRING_TO_JSVAL">STRING_TO_JSVAL</a>
</li><li> <a href="en/JSVAL_TO_GCTHING">JSVAL_TO_GCTHING</a>
</li><li> <a href="en/JSVAL_TO_PRIVATE">JSVAL_TO_PRIVATE</a>, <a href="en/PRIVATE_TO_JSVAL">PRIVATE_TO_JSVAL</a>
</li></ul>
<p>And:
</p>
<ul><li> <a href="en/JS_GetTypeName">JS_GetTypeName</a>
</li></ul>
<h4 name="Memory_management"> Memory management </h4>
<p>These functions act like the Standard C <code>malloc</code> family of functions, except that errors are reported using the SpiderMonkey error APIs rather than <code>errno</code>:
</p>
<ul><li> <a href="en/JS_malloc">JS_malloc</a>
</li><li> <a href="en/JS_free">JS_free</a>
</li><li> <a href="en/JS_realloc">JS_realloc</a>
</li><li> <a href="en/JS_strdup">JS_strdup</a>
</li></ul>
<p>JavaScript objects, strings, and floating-point numbers are garbage collected.  These functions provide access to the garbage collector:
</p>
<ul><li> <a href="en/JS_GC">JS_GC</a>
</li><li> <a href="en/JS_MaybeGC">JS_MaybeGC</a>
</li><li> <a href="en/JS_SetGCParameter">JS_SetGCParameter</a>
</li><li> <a href="en/JS_SetGCCallback">JS_SetGCCallback</a>
</li><li> <a href="en/JS_SetGCCallbackRT">JS_SetGCCallbackRT</a>
</li><li> <a href="en/JS_MarkGCThing">JS_MarkGCThing</a>
</li><li> <a href="en/JS_IsAboutToBeFinalized">JS_IsAboutToBeFinalized</a>
</li><li> <a href="en/JS_ClearNewbornRoots">JS_ClearNewbornRoots</a>
</li><li> <a href="en/JS_SetGCZeal">JS_SetGCZeal</a>
</li><li> <a href="en/JS_DumpHeap">JS_DumpHeap</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li></ul>
<p>The rest of these APIs help protect objects from being destroyed by the garbage collector before the application is done using them.
</p><p>If a variable is a <i>root</i>, then anything it points to will not be freed by the garbage collector.  Failure to root objects is a very common cause of mysterious crashes.
</p>
<ul><li> <a href="en/JS_AddRoot">JS_AddRoot</a>
</li><li> <a href="en/JS_AddNamedRoot">JS_AddNamedRoot</a>
</li><li> <a href="en/JS_AddNamedRootRT">JS_AddNamedRootRT</a>
</li><li> <a href="en/JS_RemoveRoot">JS_RemoveRoot</a>
</li><li> <a href="en/JS_RemoveRootRT">JS_RemoveRootRT</a>
</li><li> <a href="en/JS_MapGCRoots">JS_MapGCRoots</a>
</li><li> <a href="en/JS_DumpNamedRoots">JS_DumpNamedRoots</a>
</li></ul>
<p>Local root scopes are another way of protecting objects from the garbage collector.
</p>
<ul><li> <a href="en/JS_EnterLocalRootScope">JS_EnterLocalRootScope</a>
</li><li> <a href="en/JS_LeaveLocalRootScope">JS_LeaveLocalRootScope</a>
</li><li> <a href="en/JS_LeaveLocalRootScopeWithResult">JS_LeaveLocalRootScopeWithResult</a>
</li><li> <a href="en/JS_ForgetLocalRoot">JS_ForgetLocalRoot</a>
</li></ul>
<p>{{template.Jsapi_minversion_inline("1.8 (not yet released)")}} If an object contains references to other GC things that are not stored in SpiderMonkey data structures ("slots"), it must implement the <code><a href="en/JSClass.mark">JSTraceOp</a></code> hook to enable the garbage collector to traverse those references.  Otherwise the garbage collector will not find all reachable objects and may collect objects that are still reachable, leading to a crash.  (In SpiderMonkey 1.7 and earlier, the <code>JSMarkOp</code> hook is used instead.  This will be deprecated when SpiderMonkey 1.8 is released.)
</p><p>The tracing APIs are used by the garbage collector and <code>JSTraceOp</code> hooks.  JSAPI applications may also use them to examine the object graph.  (For example, these APIs support very smooth integration between the JS garbage collector and other garbage collectors.)
</p>
<ul><li> <a href="en/JSVAL_IS_TRACEABLE">JSVAL_IS_TRACEABLE</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> <a href="en/JSVAL_TO_TRACEABLE">JSVAL_TO_TRACEABLE</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> <a href="en/JSVAL_TRACE_KIND">JSVAL_TRACE_KIND</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> struct <a href="en/JSTracer">JSTracer</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> <a href="en/JS_TRACER_INIT">JS_TRACER_INIT</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> <a href="en/JS_CallTracer">JS_CallTracer</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> <a href="en/JS_SET_TRACING_DETAILS">JS_SET_TRACING_DETAILS</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> <a href="en/JS_SET_TRACING_INDEX">JS_SET_TRACING_INDEX</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> <a href="en/JS_SET_TRACING_NAME">JS_SET_TRACING_NAME</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> <a href="en/JS_CALL_TRACER">JS_CALL_TRACER</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> <a href="en/JS_CALL_VALUE_TRACER">JS_CALL_VALUE_TRACER</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> <a href="en/JS_CALL_OBJECT_TRACER">JS_CALL_OBJECT_TRACER</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> <a href="en/JS_CALL_STRING_TRACER">JS_CALL_STRING_TRACER</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> <a href="en/JS_CALL_DOUBLE_TRACER">JS_CALL_DOUBLE_TRACER</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> <a href="en/JS_TraceChildren">JS_TraceChildren</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> <a href="en/JS_TraceRuntime">JS_TraceRuntime</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> <a href="en/JS_PrintTraceThingInfo">JS_PrintTraceThingInfo</a> (DEBUG-only) {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li></ul>
<p>Miscellaneous GC APIs:
</p>
<ul><li> <a href="en/JSVAL_LOCK">JSVAL_LOCK</a> {{template.Deprecated_inline()}}
</li><li> <a href="en/JSVAL_UNLOCK">JSVAL_UNLOCK</a> {{template.Deprecated_inline()}}
</li><li> <a href="en/JS_LockGCThing">JS_LockGCThing</a> {{template.Deprecated_inline()}}
</li><li> <a href="en/JS_LockGCThingRT">JS_LockGCThingRT</a>
</li><li> <a href="en/JS_UnlockGCThing">JS_UnlockGCThing</a> {{template.Deprecated_inline()}}
</li><li> <a href="en/JS_UnlockGCThingRT">JS_UnlockGCThingRT</a>
</li></ul>
<h4 name="Numbers"> Numbers </h4>
<ul><li> <a href="en/JS_NewNumberValue">JS_NewNumberValue</a>, <a href="en/JS_NewDoubleValue">JS_NewDoubleValue</a>, <a href="en/JS_NewDouble">JS_NewDouble</a>
</li><li> struct <a href="en/JSConstDoubleSpec">JSConstDoubleSpec</a>	 
</li><li> <a href="en/JS_DefineConstDoubles">JS_DefineConstDoubles</a>
</li><li> <a href="en/JS_GetNaNValue">JS_GetNaNValue</a>
</li><li> <a href="en/JS_GetNegativeInfinityValue">JS_GetNegativeInfinityValue</a>
</li><li> <a href="en/JS_GetPositiveInfinityValue">JS_GetPositiveInfinityValue</a>
</li></ul>
<h4 name="Strings"> Strings </h4>
<ul><li> <a href="en/JS_NewString">JS_NewString</a>
</li><li> <a href="en/JS_NewStringCopyN">JS_NewStringCopyN</a>
</li><li> <a href="en/JS_NewStringCopyZ">JS_NewStringCopyZ</a>
</li><li> <a href="en/JS_NewUCString">JS_NewUCString</a>
</li><li> <a href="en/JS_NewUCStringCopyN">JS_NewUCStringCopyN</a>
</li><li> <a href="en/JS_NewUCStringCopyZ">JS_NewUCStringCopyZ</a>
</li><li> <a href="en/JS_NewGrowableString">JS_NewGrowableString</a>
</li><li> <a href="en/JS_NewDependentString">JS_NewDependentString</a>
</li><li> <a href="en/JS_GetEmptyStringValue">JS_GetEmptyStringValue</a>
</li><li> <a href="en/JS_CompareStrings">JS_CompareStrings</a>
</li><li> <a href="en/JS_ConcatStrings">JS_ConcatStrings</a>
</li><li> <a href="en/JS_GetStringBytes">JS_GetStringBytes</a>
</li><li> <a href="en/JS_GetStringChars">JS_GetStringChars</a>
</li><li> <a href="en/JS_GetStringLength">JS_GetStringLength</a>
</li><li> <a href="en/JS_MakeStringImmutable">JS_MakeStringImmutable</a>
</li><li> <a href="en/JS_UndependString">JS_UndependString</a>
</li></ul>
<ul><li> <a href="en/JS_CStringsAreUTF8">JS_CStringsAreUTF8</a>
</li><li> <a href="en/JS_SetCStringsAreUTF8">JS_SetCStringsAreUTF8</a>
</li><li> <a href="en/JS_DecodeBytes">JS_DecodeBytes</a>
</li><li> <a href="en/JS_EncodeCharacters">JS_EncodeCharacters</a>
</li><li> <a href="en/JS_EncodeString">JS_EncodeString</a>
</li></ul>
<p><i>Interning</i> strings tells the SpiderMonkey engine to reuse existing string objects when possible.
</p>
<ul><li> <a href="en/JS_InternString">JS_InternString</a>
</li><li> <a href="en/JS_InternUCString">JS_InternUCString</a>
</li><li> <a href="en/JS_InternUCStringN">JS_InternUCStringN</a>
</li></ul>
<p>The character data for <i>external strings</i> is stored in memory provided by the application.  Applications can use this to avoid copying data back and forth between SpiderMonkey's heap and application memory.
</p>
<ul><li> <a href="en/JS_AddExternalStringFinalizer">JS_AddExternalStringFinalizer</a>
</li><li> <a href="en/JS_RemoveExternalStringFinalizer">JS_RemoveExternalStringFinalizer</a>
</li><li> <a href="en/JS_GetExternalStringGCType">JS_GetExternalStringGCType</a>
</li><li> <a href="en/JS_NewExternalString">JS_NewExternalString</a>
</li></ul>
<h4 name="Objects"> Objects </h4>
<ul><li> <a href="en/JS_ConstructObject">JS_ConstructObject</a>
</li><li> <a href="en/JS_ConstructObjectWithArguments">JS_ConstructObjectWithArguments</a>
</li><li> <a href="en/JS_DefineObject">JS_DefineObject</a>
</li><li> <a href="en/JS_NewObject">JS_NewObject</a>
</li><li> <a href="en/JS_NewObjectWithGivenProto">JS_NewObjectWithGivenProto</a>
</li></ul>
<ul><li> <a href="en/JS_GET_CLASS">JS_GET_CLASS</a>
</li><li> <a href="en/JS_GetClass">JS_GetClass</a>
</li><li> <a href="en/JS_GetClassObject">JS_GetClassObject</a>
</li><li> <a href="en/JS_GetConstructor">JS_GetConstructor</a>
</li><li> <a href="en/JS_GetGlobalForObject">JS_GetGlobalForObject</a>
</li><li> <a href="en/JS_GetInstancePrivate">JS_GetInstancePrivate</a>
</li><li> <a href="en/JS_GetParent">JS_GetParent</a>, <a href="en/JS_SetParent">JS_SetParent</a>
</li><li> <a href="en/JS_GetPrivate">JS_GetPrivate</a>, <a href="en/JS_SetPrivate">JS_SetPrivate</a>
</li><li> <a href="en/JS_GetPrototype">JS_GetPrototype</a>, <a href="en/JS_SetPrototype">JS_SetPrototype</a>
</li><li> <a href="en/JS_GetReservedSlot">JS_GetReservedSlot</a>, <a href="en/JS_SetReservedSlot">JS_SetReservedSlot</a>
</li><li> <a href="en/JS_HasInstance">JS_HasInstance</a>
</li><li> <a href="en/JS_InstanceOf">JS_InstanceOf</a>
</li><li> <a href="en/JS_SealObject">JS_SealObject</a>
</li></ul>
<h4 name="Properties"> Properties </h4>
<ul><li> <a href="en/JS_AlreadyHasOwnElement">JS_AlreadyHasOwnElement</a>, <a href="en/JS_AlreadyHasOwnProperty">JS_AlreadyHasOwnProperty</a>, <a href="en/JS_AlreadyHasOwnUCProperty">JS_AlreadyHasOwnUCProperty</a> {{template.Jsapi_minversion_inline("1.8 (not yet released)")}}
</li><li> <a href="en/JS_ClearScope">JS_ClearScope</a>
</li><li> <a href="en/JS_DefineProperties">JS_DefineProperties</a>
</li><li> <a href="en/JS_DefineProperty">JS_DefineProperty</a>, <a href="en/JS_DefineUCProperty">JS_DefineUCProperty</a>
</li><li> <a href="en/JS_DefinePropertyWithTinyId">JS_DefinePropertyWithTinyId</a>, <a href="en/JS_DefineUCPropertyWithTinyId">JS_DefineUCPropertyWithTinyId</a>
</li><li> <a href="en/JS_DeleteProperty">JS_DeleteProperty</a>
</li><li> <a href="en/JS_DeleteProperty2">JS_DeleteProperty2</a>, <a href="en/JS_DeleteUCProperty2">JS_DeleteUCProperty2</a>
</li><li> <a href="en/JS_Enumerate">JS_Enumerate</a>
</li><li> <a href="en/JS_GetProperty">JS_GetProperty</a>, <a href="en/JS_GetUCProperty">JS_GetUCProperty</a>
</li><li> <a href="en/JS_GetPropertyAttributes">JS_GetPropertyAttributes</a>, <a href="en/JS_GetUCPropertyAttributes">JS_GetUCPropertyAttributes</a>
</li><li> <a href="en/JS_GetPropertyAttrsGetterAndSetter">JS_GetPropertyAttrsGetterAndSetter</a>, <a href="en/JS_GetUCPropertyAttrsGetterAndSetter">JS_GetUCPropertyAttrsGetterAndSetter</a>
</li><li> <a href="en/JS_HasProperty">JS_HasProperty</a>, <a href="en/JS_HasUCProperty">JS_HasUCProperty</a>
</li><li> <a href="en/JS_LookupProperty">JS_LookupProperty</a>, <a href="en/JS_LookupUCProperty">JS_LookupUCProperty</a>
</li><li> <a href="en/JS_LookupPropertyWithFlags">JS_LookupPropertyWithFlags</a>
</li><li> <a href="en/JS_NewPropertyIterator">JS_NewPropertyIterator</a>
</li><li> <a href="en/JS_NextProperty">JS_NextProperty</a>
</li><li> <a href="en/JS_SetProperty">JS_SetProperty</a>, <a href="en/JS_SetUCProperty">JS_SetUCProperty</a>
</li><li> <a href="en/JS_SetPropertyAttributes">JS_SetPropertyAttributes</a>, <a href="en/JS_SetUCPropertyAttributes">JS_SetUCPropertyAttributes</a>
</li><li> <a href="en/JS_AliasProperty">JS_AliasProperty</a> {{template.Deprecated_inline()}}
</li></ul>
<ul><li> <a href="en/JS_GetMethod">JS_GetMethod</a>
</li><li> <a href="en/JS_GetMethodById">JS_GetMethodById</a>
</li></ul>
<p>A SpiderMonkey extension allows a native function to return an lvalue—that is, a reference to a property of an object:
</p>
<ul><li> <a href="en/JS_SetCallReturnValue2">JS_SetCallReturnValue2</a>
</li></ul>
<p>A <code><a href="en/Jsid">jsid</a></code> is kind of like a <code>jsval</code>, only different.  A handful of APIs use <code>jsid</code>s instead of <code>jsval</code>s for property names: <code><a href="en/JS_CheckAccess">JS_CheckAccess</a></code>, <code><a href="en/JS_Enumerate">JS_Enumerate</a></code>, <code><a href="en/JS_GetMethodById">JS_GetMethodById</a></code>, and <code><a href="en/JS_NextProperty">JS_NextProperty</a></code>.
</p>
<ul><li> <a href="en/JS_IdToValue">JS_IdToValue</a>, <a href="en/JS_ValueToId">JS_ValueToId</a>
</li><li> <a href="en/JS_GetObjectId">JS_GetObjectId</a>
</li><li> struct <a href="en/JSIdArray">JSIdArray</a>
</li><li> <a href="en/JS_NewIdArray">JS_NewIdArray</a>, <a href="en/JS_DestroyIdArray">JS_DestroyIdArray</a>
</li></ul>
<h4 name="Classes"> Classes </h4>
<p>These API features are used to define custom classes—object types that are implemented in C/C++ code but accessible from JavaScript.
</p>
<ul><li> struct <a href="en/JSClass">JSClass</a>
</li><li> struct <a href="en/JSExtendedClass">JSExtendedClass</a>
</li><li> struct <a href="en/JSObjectOps">JSObjectOps</a>
</li><li> struct <a href="en/JSXMLObjectOps">JSXMLObjectOps</a>
</li><li> struct <a href="en/JSFunctionSpec">JSFunctionSpec</a>
</li><li> struct <a href="en/JSProperty">JSProperty</a>
</li><li> struct <a href="en/JSPropertySpec">JSPropertySpec</a>
</li><li> <a href="en/JS_InitClass">JS_InitClass</a>
</li></ul>
<p>Adding native properties and methods to classes:
</p>
<ul><li> <a href="en/JSNative">JSNative</a>
</li><li> <a href="en/JSFastNative">JSFastNative</a>
</li><li> struct <a href="en/JSFunctionSpec">JSFunctionSpec</a>
</li><li> <a href="en/JS_FS">JS_FS</a>
</li><li> <a href="en/JS_FN">JS_FN</a>
</li><li> <a href="en/JS_FS_END">JS_FS_END</a>
</li><li> struct <a href="en/JSPropertySpec">JSPropertySpec</a>
</li></ul>
<p><code>JSFastNative</code> methods use these macros:
</p>
<ul><li> <a href="en/JS_CALLEE">JS_CALLEE</a>
</li><li> <a href="en/JS_THIS">JS_THIS</a>
</li><li> <a href="en/JS_THIS_OBJECT">JS_THIS_OBJECT</a>
</li><li> <a href="en/JS_ARGV">JS_ARGV</a>
</li><li> <a href="en/JS_RVAL">JS_RVAL</a>
</li><li> <a href="en/JS_SET_RVAL">JS_SET_RVAL</a>
</li></ul>
<p>The behavior of a <code>JSClass</code> and its instances can be customized in many ways using callback functions.
</p><p><a href="en/JSClass">JSClass</a> method types:
</p>
<ul><li> <a href="en/JSPropertyOp">JSPropertyOp</a>
</li><li> <a href="en/JSEnumerateOp">JSEnumerateOp</a>
</li><li> <a href="en/JSNewEnumerateOp">JSNewEnumerateOp</a>
</li><li> <a href="en/JSResolveOp">JSResolveOp</a>
</li><li> <a href="en/JSNewResolveOp">JSNewResolveOp</a>
</li><li> <a href="en/JSConvertOp">JSConvertOp</a>
</li><li> <a href="en/JSFinalizeOp">JSFinalizeOp</a>
</li><li> <a href="en/JSGetObjectOps">JSGetObjectOps</a>
</li><li> <a href="en/JSCheckAccessOp">JSCheckAccessOp</a>
</li><li> <a href="en/JSXDRObjectOp">JSXDRObjectOp</a>
</li><li> <a href="en/JSHasInstanceOp">JSHasInstanceOp</a>
</li><li> <a href="en/JSMarkOp">JSMarkOp</a>
</li><li> <a href="en/JSTraceOp">JSTraceOp</a>
</li><li> <a href="en/JSReserveSlotsOp">JSReserveSlotsOp</a>
</li></ul>
<p><a href="en/JSExtendedClass">JSExtendedClass</a> method types:
</p>
<ul><li> <a href="en/JSIteratorOp">JSIteratorOp</a>
</li><li> <a href="en/JSEqualityOp">JSEqualityOp</a>
</li><li> <a href="en/JSObjectOp">JSObjectOp</a>
</li></ul>
<p><a href="en/JSObjectOps">JSObjectOps</a> method types:
</p>
<ul><li> <a href="en/JSNewObjectMapOp">JSNewObjectMapOp</a>
</li><li> <a href="en/JSObjectMapOp">JSObjectMapOp</a>
</li><li> <a href="en/JSLookupPropOp">JSLookupPropOp</a>
</li><li> <a href="en/JSDefinePropOp">JSDefinePropOp</a>
</li><li> <a href="en/JSPropertyIdOp">JSPropertyIdOp</a>
</li><li> <a href="en/JSAttributesOp">JSAttributesOp</a>
</li><li> <a href="en/JSConvertOp">JSConvertOp</a>
</li><li> <a href="en/JSNewEnumerateOp">JSNewEnumerateOp</a>
</li><li> <a href="en/JSCheckAccessIdOp">JSCheckAccessIdOp</a>
</li><li> <a href="en/JSObjectOp">JSObjectOp</a>
</li><li> <a href="en/JSPropertyRefOp">JSPropertyRefOp</a>
</li><li> <a href="en/JSXDRObjectOp">JSXDRObjectOp</a>
</li><li> <a href="en/JSHasInstanceOp">JSHasInstanceOp</a>
</li><li> <a href="en/JSSetObjectSlotOp">JSSetObjectSlotOp</a>
</li><li> <a href="en/JSTraceOp">JSTraceOp</a>
</li><li> <a href="en/JSFinalizeOp">JSFinalizeOp</a>
</li><li> <a href="en/JSGetRequiredSlotOp">JSGetRequiredSlotOp</a>
</li><li> <a href="en/JSGetRequiredSlotOp">JSSetRequiredSlotOp</a>
</li></ul>
<p><a href="en/JSXMLObjectOps">JSXMLObjectOps</a> method types:
</p>
<ul><li> <a href="en/JSGetMethodOp">JSGetMethodOp</a>
</li><li> <a href="en/JSSetMethodOp">JSSetMethodOp</a>
</li><li> <a href="en/JSEnumerateValuesOp">JSEnumerateValuesOp</a>
</li><li> <a href="en/JSEqualityOp">JSEqualityOp</a>
</li><li> <a href="en/JSConcatenateOp">JSConcatenateOp</a>
</li></ul>
<p>These stub functions can be used when creating a custom <code><a href="en/JSClass">JSClass</a></code>:
</p>
<ul><li> <a href="en/JS_ConvertStub">JS_ConvertStub</a>
</li><li> <a href="en/JS_EnumerateStub">JS_EnumerateStub</a>
</li><li> <a href="en/JS_FinalizeStub">JS_FinalizeStub</a>
</li><li> <a href="en/JS_PropertyStub">JS_PropertyStub</a>
</li><li> <a href="en/JS_ResolveStub">JS_ResolveStub</a>
</li></ul>
<h4 name="Arrays"> Arrays </h4>
<ul><li> <a href="en/JS_NewArrayObject">JS_NewArrayObject</a>
</li><li> <a href="en/JS_IsArrayObject">JS_IsArrayObject</a>
</li></ul>
<ul><li> <a href="en/JS_HasArrayLength">JS_HasArrayLength</a>
</li><li> <a href="en/JS_GetArrayLength">JS_GetArrayLength</a>
</li><li> <a href="en/JS_SetArrayLength">JS_SetArrayLength</a>
</li></ul>
<ul><li> <a href="en/JS_AliasElement">JS_AliasElement</a> {{template.Deprecated_inline()}}
</li><li> <a href="en/JS_DefineElement">JS_DefineElement</a>
</li><li> <a href="en/JS_DeleteElement">JS_DeleteElement</a>
</li><li> <a href="en/JS_DeleteElement2">JS_DeleteElement2</a>
</li><li> <a href="en/JS_GetElement">JS_GetElement</a>
</li><li> <a href="en/JS_LookupElement">JS_LookupElement</a>
</li><li> <a href="en/JS_SetElement">JS_SetElement</a>
</li></ul>
<h4 name="Functions_2"> Functions </h4>
<p>Calling a function or a method of an object:
</p>
<ul><li> <a href="en/JS_CallFunction">JS_CallFunction</a>
</li><li> <a href="en/JS_CallFunctionName">JS_CallFunctionName</a>
</li><li> <a href="en/JS_CallFunctionValue">JS_CallFunctionValue</a>
</li></ul>
<p>Function accessors:
</p>
<ul><li> <a href="en/JS_ObjectIsFunction">JS_ObjectIsFunction</a>
</li><li> <a href="en/JS_GetFunctionArity">JS_GetFunctionArity</a>
</li><li> <a href="en/JS_GetFunctionFlags">JS_GetFunctionFlags</a>
</li><li> <a href="en/JS_GetFunctionId">JS_GetFunctionId</a>
</li><li> <a href="en/JS_GetFunctionName">JS_GetFunctionName</a> {{template.Deprecated_inline()}}
</li><li> <a href="en/JS_GetFunctionObject">JS_GetFunctionObject</a>
</li></ul>
<p>Creating functions:
</p>
<ul><li> <a href="en/JS_CloneFunctionObject">JS_CloneFunctionObject</a>
</li><li> <a href="en/JS_DefineFunction">JS_DefineFunction</a>, <a href="en/JS_DefineUCFunction">JS_DefineUCFunction</a>
</li><li> <a href="en/JS_DefineFunctions">JS_DefineFunctions</a>
</li><li> <a href="en/JS_DefineUCFunction">JS_DefineUCFunction</a>
</li><li> <a href="en/JS_NewFunction">JS_NewFunction</a>
</li></ul>
<h4 name="RegExps"> RegExps </h4>
<ul><li> <a href="en/JS_NewRegExpObject">JS_NewRegExpObject</a>
</li><li> <a href="en/JS_SetRegExpInput">JS_SetRegExpInput</a>
</li><li> <a href="en/JS_ClearRegExpRoots">JS_ClearRegExpRoots</a>
</li><li> <a href="en/JS_ClearRegExpStatics">JS_ClearRegExpStatics</a>
</li></ul>
<h4 name="Security"> Security </h4>
<ul><li> struct <a href="en/JSPrincipals">JSPrincipals</a>
</li><li> enum <a href="en/JSAccessMode">JSAccessMode</a>, <a href="en/JSACC_PROTO">JSACC_PROTO</a>, <a href="en/JSACC_PARENT">JSACC_PARENT</a>, <a href="en/JSACC_IMPORT">JSACC_IMPORT</a>, <a href="en/JSACC_WATCH">JSACC_WATCH</a>, <a href="en/JSACC_READ">JSACC_READ</a>, <a href="en/JSACC_WRITE">JSACC_WRITE</a>
</li><li> <a href="en/JS_CheckAccess">JS_CheckAccess</a>
</li><li> <a href="en/JSObjectOps.checkAccess">JSObjectOps.checkAccess</a>
</li><li> <a href="en/JSClass.checkAccess">JSClass.checkAccess</a>
</li><li> <a href="en/JS_HoldPrincipals">JS_HoldPrincipals</a>, <a href="en/JS_DropPrincipals">JS_DropPrincipals</a>
</li><li> <a href="en/JSPRINCIPALS_HOLD">JSPRINCIPALS_HOLD</a>, <a href="en/JSPRINCIPALS_DROP">JSPRINCIPALS_DROP</a>
</li><li> <a href="en/JS_SetCheckObjectAccessCallback">JS_SetCheckObjectAccessCallback</a>
</li><li> <a href="en/JS_SetObjectPrincipalsFinder">JS_SetObjectPrincipalsFinder</a>
</li><li> <a href="en/JS_SetPrincipalsTranscoder">JS_SetPrincipalsTranscoder</a>
</li></ul>
<h4 name="Threading"> Threading </h4>
<p>The following functions support the SpiderMonkey threading model.  They are only available in <code><a href="en/JS_THREADSAFE">JS_THREADSAFE</a></code> builds.
</p>
<ul><li> <a href="en/JS_BeginRequest">JS_BeginRequest</a>
</li><li> <a href="en/JS_EndRequest">JS_EndRequest</a>
</li><li> <a href="en/JS_YieldRequest">JS_YieldRequest</a>
</li><li> <a href="en/JS_SuspendRequest">JS_SuspendRequest</a>
</li><li> <a href="en/JS_ResumeRequest">JS_ResumeRequest</a>
</li><li> <a href="en/JS_GetContextThread">JS_GetContextThread</a>
</li><li> <a href="en/JS_SetContextThread">JS_SetContextThread</a>
</li><li> <a href="en/JS_ClearContextThread">JS_ClearContextThread</a>
</li></ul>
<p>The following functions exist in all builds, but in non-<code><a href="en/JS_THREADSAFE">JS_THREADSAFE</a></code> builds, they do nothing:
</p>
<ul><li> <a href="en/JS_LockRuntime">JS_LockRuntime</a>
</li><li> <a href="en/JS_UnlockRuntime">JS_UnlockRuntime</a>
</li><li> <a href="en/JS_Lock">JS_Lock</a> {{template.Deprecated_inline()}}
</li><li> <a href="en/JS_Unlock">JS_Unlock</a> {{template.Deprecated_inline()}}
</li></ul>
<h4 name="Time"> Time </h4>
<ul><li> <a href="en/JS_Now">JS_Now</a>
</li></ul>
<h3 name="Callback_Types"> Callback Types </h3>
<p>Native function types:
</p>
<ul><li> <a href="en/JSNative">JSNative</a>
</li><li> <a href="en/JSFastNative">JSFastNative</a>
</li></ul>
<p>Other callback types:
</p>
<ul><li> <a href="en/JSStringFinalizeOp">JSStringFinalizeOp</a> - used by <a href="en/JS_AddExternalStringFinalizer">JS_AddExternalStringFinalizer</a>
</li><li> <a href="en/JSTraceCallback">JSTraceCallback</a> - used by <a href="en/JS_TRACER_INIT">JS_TRACER_INIT</a>
</li><li> <a href="en/JSTraceNamePrinter">JSTraceNamePrinter</a> - used by <a href="en/JS_SET_TRACING_DETAILS">JS_SET_TRACING_DETAILS</a>
</li><li> <a href="en/JSContextCallback">JSContextCallback</a> - used by <a href="en/JS_SetContextCallback">JS_SetContextCallback</a>
</li><li> <a href="en/JSGCCallback">JSGCCallback</a> - used by <a href="en/JS_SetGCCallback">JS_SetGCCallback</a>
</li><li> <a href="en/JSTraceDataOp">JSTraceDataOp</a> - used by <a href="en/JS_SetExtraGCRoots">JS_SetExtraGCRoots</a>
</li><li> <a href="en/JSBranchCallback">JSBranchCallback</a> - used by <a href="en/JS_SetBranchCallback">JS_SetBranchCallback</a>
</li><li> <a href="en/JSErrorReporter">JSErrorReporter</a> - used by <a href="en/JS_SetErrorReporter">JS_SetErrorReporter</a>
</li><li> <a href="en/JSErrorCallback">JSErrorCallback</a> - used by <a href="en/JS_ReportErrorNumber">JS_ReportErrorNumber</a> and friends
</li><li> <a href="en/JSArgumentFormatter">JSArgumentFormatter</a> - used by <a href="en/JS_AddArgumentFormatter">JS_AddArgumentFormatter</a>
</li><li> <a href="en/JSPrincipalsTranscoder">JSPrincipalsTranscoder</a> - used by <a href="en/JS_SetPrincipalsTranscoder">JS_SetPrincipalsTranscoder</a>
</li><li> <a href="en/JSObjectPrincipalsFinder">JSObjectPrincipalsFinder</a> - used by <a href="en/JS_SetObjectPrincipalsFinder">JS_SetObjectPrincipalsFinder</a>
</li><li> <a href="en/JSGCRootMapFun">JSGCRootMapFun</a> - used by <a href="en/JS_MapGCRoots">JS_MapGCRoots</a>
</li></ul>
<p>See also <a href="#Classes">Classes</a>, above.
</p>
<h3 name="Macros"> Macros </h3>
<ul><li> <a href="en/JS_DEFAULT_XML_NAMESPACE_ID">JS_DEFAULT_XML_NAMESPACE_ID</a>
</li><li> <a href="en/JS_MAP_GCROOT_NEXT">JS_MAP_GCROOT_NEXT</a>
</li><li> <a href="en/JS_MAP_GCROOT_REMOVE">JS_MAP_GCROOT_REMOVE</a>
</li><li> <a href="en/JS_MAP_GCROOT_STOP">JS_MAP_GCROOT_STOP</a>
</li><li> <a href="en/JSCLASS_CONSTUCT_PROTOTYPE">JSCLASS_CONSTUCT_PROTOTYPE</a>
</li><li> <a href="en/JSCLASS_HAS_PRIVATE">JSCLASS_HAS_PRIVATE</a>
</li><li> <a href="en/JSCLASS_HAS_RESERVED_SLOTS">JSCLASS_HAS_RESERVED_SLOTS</a>
</li><li> <a href="en/JSCLASS_IS_EXTENDED">JSCLASS_IS_EXTENDED</a>
</li><li> <a href="en/JSCLASS_NEW_ENUMERATE">JSCLASS_NEW_ENUMERATE</a>
</li><li> <a href="en/JSCLASS_NEW_RESOLVE">JSCLASS_NEW_RESOLVE</a>
</li><li> <a href="en/JSCLASS_RESERVED_SLOTS">JSCLASS_RESERVED_SLOTS</a>
</li><li> <a href="en/JSCLASS_SHARE_ALL_PROPERTIES">JSCLASS_SHARE_ALL_PROPERTIES</a>
</li><li> <a href="en/JSFUN_BOUND_METHOD">JSFUN_BOUND_METHOD</a> {{template.Deprecated_inline()}}
</li><li> <a href="en/JSFUN_GETTER">JSFUN_GETTER</a>
</li><li> <a href="en/JSFUN_GLOBAL_PARENT">JSFUN_GLOBAL_PARENT</a> {{template.Deprecated_inline()}}
</li><li> <a href="en/JSFUN_HEAVYWEIGHT">JSFUN_HEAVYWEIGHT</a>
</li><li> <a href="en/JSFUN_LAMBDA">JSFUN_LAMBDA</a>
</li><li> <a href="en/JSFUN_SETTER">JSFUN_SETTER</a>
</li><li> <a href="en/JSGC_MAX_BYTES">JSGC_MAX_BYTES</a>
</li><li> <a href="en/JSGC_MAX_MALLOC_BYTES">JSGC_MAX_MALLOC_BYTES</a>
</li><li> <a href="en/JSOPTION_ATLINE">JSOPTION_ATLINE</a>
</li><li> <a href="en/JSOPTION_COMPILE_N_GO">JSOPTION_COMPILE_N_GO</a>
</li><li> <a href="en/JSOPTION_DONT_REPORT_UNCAUGHT">JSOPTION_DONT_REPORT_UNCAUGHT</a>
</li><li> <a href="en/JSOPTION_NATIVE_BRANCH_CALLBACK">JSOPTION_NATIVE_BRANCH_CALLBACK</a>
</li><li> <a href="en/JSOPTION_RELIMIT">JSOPTION_RELIMIT</a>
</li><li> <a href="en/JSOPTION_STRICT">JSOPTION_STRICT</a>
</li><li> <a href="en/JSOPTION_VAROBJFIX">JSOPTION_VAROBJFIX</a>
</li><li> <a href="en/JSOPTION_WERROR">JSOPTION_WERROR</a>
</li><li> <a href="en/JSOPTION_XML">JSOPTION_XML</a>
</li><li> <a href="en/JSPROP_ENUMERATE">JSPROP_ENUMERATE</a>
</li><li> <a href="en/JSPROP_EXPORTED">JSPROP_EXPORTED</a>
</li><li> <a href="en/JSPROP_GETTER">JSPROP_GETTER</a>
</li><li> <a href="en/JSPROP_INDEX">JSPROP_INDEX</a>
</li><li> <a href="en/JSPROP_PERMANENT">JSPROP_PERMANENT</a>
</li><li> <a href="en/JSPROP_READONLY">JSPROP_READONLY</a>
</li><li> <a href="en/JSPROP_SETTER">JSPROP_SETTER</a>
</li><li> <a href="en/JSPROP_SHARED">JSPROP_SHARED</a>
</li><li> <a href="en/JSREG_GLOB">JSREG_GLOB</a>
</li><li> <a href="en/JSREG_FOLD">JSREG_FOLD</a>
</li><li> <a href="en/JSREG_MULTILINE">JSREG_MULTILINE</a>
</li><li> <a href="en/JSRESOLVE_ASSIGNING">JSRESOLVE_ASSIGNING</a>
</li><li> <a href="en/JSRESOLVE_CLASSNAME">JSRESOLVE_CLASSNAME</a>
</li><li> <a href="en/JSRESOLVE_DECLARING">JSRESOLVE_DECLARING</a>
</li><li> <a href="en/JSRESOLVE_DETECTING">JSRESOLVE_DETECTING</a>
</li><li> <a href="en/JSRESOLVE_QUALIFIED">JSRESOLVE_QUALIFIED</a>
</li></ul>
<p><br>
</p>
<h3 name="Preprocessor_conditionals"> Preprocessor conditionals </h3>
<ul><li> <a href="en/BUILD_OPT">BUILD_OPT</a>
</li><li> <a href="en/GC_MARK_DEBUG">GC_MARK_DEBUG</a>
</li><li> <a href="en/JS_ARENAMETER">JS_ARENAMETER</a>
</li><li> <a href="en/JS_GCMETER">JS_GCMETER</a>
</li><li> <a href="en/JS_HASHMETER">JS_HASHMETER</a>
</li><li> <a href="en/JS_THREADSAFE">JS_THREADSAFE</a>
</li></ul>
{{ wiki.languages( { "ja": "ja/JSAPI_Reference", "pl": "pl/Dokumentacja_JSAPI" } ) }}
Revert to this revision