Index

Found 548 pages:

# Page Tags and summary
1 SpiderMonkey SpiderMonkey
Standalone source code releases can be found on the Releases page.
2 Creating JavaScript tests Automated testing, Build documentation, Guide, QA, SpiderMonkey
Most new tests could go in either suite. The main differences are:
3 FOSS Guide, SpiderMonkey
Feel free to add your own SpiderMonkey-based open source projects (and if necessary add categories)!
4 Future directions Guide, Mozilla, SpiderMonkey
This article documents future directions in functionality, design, and coding practices for SpiderMonkey. It can be read as something like an "ideal future state" for the engine. That means the code as it is today won't match this document, and that's OK. Whenever practical, new code and changes should move code closer to the ideal future. And of course, the idea of the future is always evolving in time as things change and we learn more.
5 GC Rooting Guide SpiderMonkey
No summary!
6 Getting SpiderMonkey source code Guide, SpiderMonkey
You can get the SpiderMonkey source code in gzipped form or directly from the Mercurial repository.
7 Hacking Tips SpiderMonkey
This page list a few tips to help you investigate issues related to SpiderMonkey. All tips listed here are dealing with the JavaScript shell obtained at the end of the build documentation of SpiderMonkey. It is separated in 2 parts, one section related to debugging and another section related to drafting optimizations. Many of these tips only apply to debug builds of the JS shell; they will not function in a release build.
8 How to embed the JavaScript engine Embedding Mozilla, JavaScript, SpiderMonkey, Tutorial
See also JSAPI User Guide. In particular, it has more and better code examples!
9 Index Index, MDN Meta, SpiderMonkey
Found 548 pages:
10 Introduction to the JavaScript shell SpiderMonkey
To get the SpiderMonkey JavaScript shell, see the SpiderMonkey Build Documentation or download a compiled binary for your platform from the Nightly Builds.
11 JIT Optimization Outcomes
SpiderMonkey's optimizing JIT, IonMonkey, uses different optimization strategies to speed up various operations. The most typical operations that are relevant for fast program execution are property accesses and function calls.
12 JIT Optimization Strategies SpiderMonkey
SpiderMonkey's optimizing JIT, IonMonkey, uses various strategies to optimize operations. The most commonplace operations that are relevant for fast program execution are property accesses and function calls.
13 JSAPI Cookbook SpiderMonkey
This article shows the JSAPI equivalent for a tiny handful of common JavaScript idioms.
14 JSAPI User Guide JSAPI, SpiderMonkey
This document explains how to embed SpiderMonkey, the Mozilla JavaScript engine, in your C++ program.
15 JSAPI reference NeedsContent, SpiderMonkey
JS::DeflateStringToUTF8Buffer
16 BOOLEAN_TO_JSVAL JSAPI Reference, Obsolete, SpiderMonkey
BOOLEAN_TO_JSVAL converts a bool argument, b, to a boolean jsval.
17 DOUBLE_TO_JSVAL JSAPI Reference, Obsolete, SpiderMonkey
DOUBLE_TO_JSVAL is the inverse of JS::ToNumber.
18 INT_FITS_IN_JSVAL JSAPI Reference, Obsolete, SpiderMonkey
Determines if a specified C integer value, i, lies within the range allowed for integer jsvals. If so, INT_FITS_IN_JSVAL returns TRUE, and i can be cast to jsval by calling INT_TO_JSVAL(i). Otherwise, INT_FITS_IN_JSVAL returns FALSE. In this case, the application can still convert i to a jsval using JS_NewNumberValue.
19 INT_TO_JSVAL JSAPI Reference, Obsolete, SpiderMonkey
INT_TO_JSVAL converts a C integer, i, to a jsval.
20 JS::Add*Root JSAPI Reference, NeedsContent, Obsolete, Reference, Référence, SpiderMonkey
These functions are obsoleted, use JS::PersistentRooted instead.
21 JS::AutoIdArray JSAPI Reference, Reference, Référence, SpiderMonkey
JS::AutoIdArray takes the ownership of JSIdArray, and frees it in destructor by calling JS_DestroyIdArray.
22 JS::AutoSaveExceptionState JSAPI Reference, Reference, Référence, SpiderMonkey
JS::AutoSaveExceptionState saves and later restores the current exception state of a given JSContext.
23 JS::AutoValueArray JSAPI Reference, Reference, Référence, SpiderMonkey
JS::AutoValueArray<N> holds a rooted array of JS::Value. This is typically used for local variables being passed to function which requires JS::HandleValueArray or a pointer to JS::Value array.
24 JS::AutoVectorRooter JSAPI Reference, Reference, Référence, SpiderMonkey
JS::AutoVectorRooter<T> holds a variable-size rooted array of type T.
25 JS::BooleanValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
26 JS::Call JSAPI Reference, Reference, Référence, SpiderMonkey
JS::Call calls a specified function, fun, on an object, thisObj. In terms of function execution, the object is treated as this.
27 JS::CallArgs JSAPI Reference, Reference, Référence, SpiderMonkey
JS::CallArgs is helper class encapsulating access to the callee, this value, arguments, and argument count for a function call.
28 JS::CloneFunctionObject JSAPI Reference, Reference, Référence, SpiderMonkey
JS::CloneFunctionObject creates a new function object from funobj. The new object has the same code and argument list as funobj. If scopeChain is supplied, it uses scopeChain as its enclosing scope. If scopeChain is omitted, it creates a new function object in cx's global. This can be helpful if funobj is an extant function that you wish to use as if it were enclosed by a newly-created global object.
29 JS::Compile JSAPI Reference, Reference, Référence, SpiderMonkey
JS::Compile compiles a script, srcBuf, chars, bytes, or file, for execution.
30 JS::CompileFunction JSAPI Reference, Reference, Référence, SpiderMonkey
JS::CompileFunction compiles a function from a text string chars, bytes, or srcBuf.
31 JS::CompileOffThread JSAPI Reference, Reference, Référence, SpiderMonkey
JS::CompileOffThread compiles a script, chars for execution.
32 JS::CompileOptions JSAPI Reference, Reference, Référence, SpiderMonkey
Some methods of JS::OwningCompileOptions and JS::CompileOptions return the instance itself to allow method chain.
33 JS::Construct JSAPI Reference, Reference, Référence, SpiderMonkey
JS::Construct calls a specified function as a constructor, fun.
34 JS::CreateError JSAPI Reference, Reference, Référence, SpiderMonkey
JS::CreateError creates an Error object with specified properties.
35 JS::CurrentGlobalOrNull JSAPI Reference, Reference, Référence, SpiderMonkey
JS::CurrentGlobalOrNull() returns the global object for whatever function is currently running on the context. In other words, it returns the global object on the current scope chain.
36 JS::DeflateStringToUTF8Buffer JSAPI Reference, Refere, SpiderMonkey
JS::DeflateStringToUTF8Buffer encodes src as UTF8. The caller must either ensure dst has enough space to encode the entire string, or pass the length of the buffer as dstlenp. In which case, the function will encode characters from the string until the buffer is exhausted. Does not write the null terminator.
37 JS::DoubleNaNValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
38 JS::DoubleValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
39 JS::Evaluate JSAPI Reference, Reference, Référence, SpiderMonkey
JS::Evaluate compiles and executes a script in the specified scope, obj or scopeChain.
40 JS::FalseValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
41 JS::Float32Value JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
42 JS::GetDeflatedUTF8StringLength JSAPI Reference, Reference, Référence, SpiderMonkey
JS::GetDeflatedUTF8StringLength returns the length of the char buffer required to encode s as UTF8. The returned length does not include the null-terminator.
43 JS::GetFirstArgumentAsTypeHint JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
44 JS::GetSelfHostedFunction JSAPI Reference, Reference, Référence, SpiderMonkey
JS::GetSelfHostedFunction creates a new JavaScript function implemented in self-hosted JavaScript.
45 JS::Handle JSAPI Reference, Reference, Référence, SpiderMonkey
Here, ptr represents the private member of JS::Handle<T>, typed with T.
46 JS::HandleValueArray JSAPI Reference, Reference, Référence, SpiderMonkey
JS::HandleValueArray is a handle to an array of rooted values. This is useful as a parameter type, or a temporal local variable for it.
47 JS::IdentifyStandardInstance JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
48 JS::Int32Value JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
49 JS::IsCallable JSAPI Reference, Reference, Référence, SpiderMonkey
JS::IsCallable returns whether the given function object is callable.
50 JS::MutableHandle JSAPI Reference, Reference, Référence, SpiderMonkey
Here, ptr represents the private member of JS::MutableHandle<T>, typed with T *.
51 JS::NewFunctionFromSpec JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
52 JS::NullHandleValue JSAPI Reference, Reference, Référence, SpiderMonkey
JS::NullHandleValue is a JS::HandleValue constant that represents the JavaScript value null.
53 JS::NullValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
54 JS::NumberValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
55 JS::ObjectOrNullValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
56 JS::ObjectValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
57 JS::OrdinaryToPrimitive JSAPI Reference, Reference, Référence, SpiderMonkey
JS::OrdinaryToPrimitive converts a JavaScript object to a specified type value, by the algorithm specified in ES6 draft rev 28 (2014 Oct 14) 7.1.1, second algorithm.
58 JS::PersistentRooted JSAPI Reference, Reference, Référence, SpiderMonkey
Here, ptr represents the private member of JS::PersistentRooted<T>, typed with T.
59 JS::PropertySpecNameEqualsId JSAPI Reference, Reference, Référence, SpiderMonkey
JS::PropertySpecNameEqualsId determines if the given JSPropertySpec::name or JSFunctionSpec::name value equals the given jsid, and returns true if so.
60 JS::PropertySpecNameIsSymbol JSAPI Reference, Reference, Référence, SpiderMonkey
JS::PropertySpecNameIsSymbol determines if the given JSPropertySpec::name or JSFunctionSpec::name value is actually a symbol code and not a string, and returns true if so.
61 JS::PropertySpecNameToPermanentId JSAPI Reference, Reference, Référence, SpiderMonkey
JS::PropertySpecNameToPermanentId creates a jsid that does not need to be marked for GC from JSPropertySpec::name or JSFunctionSpec::name. The resulting jsid, on success, is either an interned string or a well-known symbol; either way it is immune to GC so there is no need to visit *idp during GC marking..
62 JS::ProtoKeyToId JSAPI Reference, Reference, Référence, SpiderMonkey
JS::ProtoKeyToId converts a specified JS prototype key key, to a JS ID. JS::ProtoKeyToId stores a jsid to *idp.
63 JS::Remove*Root JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
JS::Remove*Root removes the variable that rp points to from the garbage collector's root set.
64 JS::Rooted JSAPI Reference, Reference, Référence, SpiderMonkey
Here, ptr represents the private member of JS::Rooted<T>, typed with T.
65 JS::SetLargeAllocationFailureCallback JSAPI Reference, Reference, Référence, SpiderMonkey
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.)
66 JS::SetOutOfMemoryCallback JSAPI Reference, Reference, Référence, SpiderMonkey
Unlike the error reporter, which is only called if the exception for an OOM bubbles up and is not caught, the JS::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.
67 JS::SourceBufferHolder JSAPI Reference, Reference, Référence, SpiderMonkey
JS::SourceBufferHolder is the 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:
68 JS::StringValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
69 JS::SymbolValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
70 JS::ToBoolean JSAPI Reference, SpiderMonkey
JS::ToBoolean converts a JavaScript value to a boolean. It implements the ToBoolean operation described in ECMA 262-3 §9.2. This function can not fail and the return value is always the boolean conversion of the argument.
71 JS::ToInt32 JSAPI Reference, Reference, Référence, SpiderMonkey
JS::ToInt32 converts a JavaScript value to a signed 32bit integer. It implements the ToInt32 operator described in ECMA 262-3 §9.5.
72 JS::ToInt64 JSAPI Reference, Reference, Référence, SpiderMonkey
JS::ToInt64 converts a JavaScript value to a signed 64bit integer.
73 JS::ToNumber JSAPI Reference, SpiderMonkey
JS::ToNumber converts a JavaScript value to a number. It implements the ToNumber operator described in ECMA 262-3 §9.3.
74 JS::ToPrimitive JSAPI Reference, SpiderMonkey
JS::ToPrimitive converts a JavaScript object, obj, to a primitive value using ECMAScript 6 ToPrimitive.
75 JS::ToString JSAPI Reference, Reference, Référence, SpiderMonkey
JS::ToString returns a string representation of a JavaScript value.
76 JS::ToUint16 JSAPI Reference, Reference, Référence, SpiderMonkey
JS::ToInt16 converts a JavaScript value to an unsigned 16bit integer. It implements the ToInt16 operator described in ECMA 262-3 §9.7.
77 JS::ToUint32 JSAPI Reference, Reference, Référence, SpiderMonkey
JS::ToInt32 converts a JavaScript value to an unsigned 32bit integer. It implements the ToInt32 operator described in ECMA 262-3 §9.6.
78 JS::ToUint64 JSAPI Reference, Reference, Référence, SpiderMonkey
JS::ToInt64 converts a JavaScript value to an unsigned 64bit integer.
79 JS::TrueHandleValue JSAPI Reference, Reference, Référence, SpiderMonkey
JS::TrueHandleValue and JS::FalseHandleValue are JS::HandleValue constants that represent the JavaScript values true and false.
80 JS::TrueValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
81 JS::UndefinedHandleValue JSAPI Reference, Reference, Référence, SpiderMonkey
JS::UndefinedHandleValue is a JS::HandleValue constant that represents the JavaScript value undefined.
82 JS::UndefinedValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
83 JS::Value JSAPI Reference, SpiderMonkey
A C++ variable of type JS::Value represents a value in JavaScript: a string, number, object (including arrays and functions), boolean, symbol, null, or undefined.
84 JSAutoByteString JSAPI Reference, Reference, Référence, SpiderMonkey
JSAutoByteString takes the ownership of string and frees it in destructor.
85 JSAutoCompartment JSAPI Reference, SpiderMonkey
No summary!
86 JSBool JSAPI Reference, Obsolete, SpiderMonkey
No summary!
87 JSCheckAccessOp JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
Check whether obj[id] may be accessed per mode, returning JS_FALSE on error/exception, JS_TRUE on success with obj[id]'s stored value in *vp. As for JSPropertyOp, id is either a string or an int jsval.
88 JSClass JSAPI Reference, SpiderMonkey
Use JSClass to define a custom class of JavaScript objects. A JSClass has a name, flags, and several callback functions for advanced customization of object behavior.
89 JSClass.call JSAPI Reference, SpiderMonkey
Note that when a custom object is called, a this argument is calculated for it just as if it were a function. That is, the obj argument received by the JSNative is the this argument, not the custom object that was called!
90 JSClass.flags JSAPI Reference, SpiderMonkey
The flags field is of type uint32_t. Its value is the logical OR of zero or more of the following constants:
91 JSConstDoubleSpec JSAPI Reference, SpiderMonkey
JSConstDoubleSpecs is used to define a set of double values that are assigned as properties to an object using JS_DefineConstDoubles.
92 JSConvertOp JSAPI Reference, Reference, Référence, SpiderMonkey
JSConvertOp callback specifies conversion behavior for objects having this class, implementing the ECMAScript [[DefaultValue]] behavior for them. On success it must return a primitive value in *vp.
93 JSDeletePropertyOp JSAPI Reference, Reference, Référence, SpiderMonkey
JSDeletePropertyOp callback is a hook that applications may install to be called at some point during property access. A JSDeletePropertyOp may be installed on a JSClass to hook property deletes.
94 JSEnumerateOp JSAPI Reference, SpiderMonkey
JSEnumerateOp is called just before an object is enumerated (via a for...in statement, an array comprehension, or a call to JS_Enumerate). It should define any remaining lazy properties that should be enumerable but are not yet defined in obj. This hook does not implement iteration: once the properties are defined, the JavaScript engine can enumerate them.
95 JSErrorFormatString JSAPI Reference, Reference, Référence, SpiderMonkey
JSErrorFormatString is a struct to represent error message and type, returned by JS_ReportErrorNumber function.
96 JSErrorReport JSAPI Reference, SpiderMonkey
JSErrorReport describes a single error that occurs in the execution of script.
97 JSExceptionState JSAPI Reference, SpiderMonkey
A JSExceptionState object is returned by the JS_SaveExceptionState function, and is passed to functions JS_RestoreExceptionState and JS_DropExceptionState.
98 JSExnType JSAPI Reference, Reference, Référence, SpiderMonkey
These types are part of a JSErrorFormatString structure. They define which error to throw in case of a runtime error. JSEXN_NONE marks an unthrowable error.
99 JSExtendedClass JSAPI Reference, Obsolete, SpiderMonkey
To implement a custom class that uses any of the JSExtendedClass callbacks:
100 JSExtendedClass.outerObject JSAPI Reference, Obsolete, SpiderMonkey
See split objects.
101 JSExtendedClass.wrappedObject JSAPI Reference, Obsolete, SpiderMonkey
If a class has the JSCLASS_IS_EXTENDED bit set in its JSClass.flags and has a non-null JSExtendedClass.wrappedObject, then objects of that class may be wrappers. In a few cases the JavaScript engine will pretend the wrapper isn't there, instead operating on the object it wraps. In these cases the engine calls the JSExtendedClass.wrappedObject callback to get the wrapped object. Most classes do not implement wrappedObject.
102 JSFUN_BOUND_METHOD JSAPI Reference, Obsolete, SpiderMonkey
This macro exists only for backward compatibility with existing applications. Its use is deprecated. Future versions of the JavaScript engine may not support or recognize this macro.
103 JSFUN_GLOBAL_PARENT JSAPI Reference, Obsolete, SpiderMonkey
No summary!
104 JSFastNative JSAPI Reference, Obsolete, SpiderMonkey
No summary!
105 JSFinalizeOp JSAPI Reference, Reference, Référence, SpiderMonkey
The JSFinalizeOp is analogous to Java finalizers or C++ destructors. The garbage collector calls this callback for each object it collects. The finalizer's job is to clean up any resources allocated by the instance which wouldn't normally be cleaned up by the garbage collector (private data stored in the object by the application, file handles, etc.)
106 JSFreeOp JSAPI Reference, Reference, Référence, SpiderMonkey
Various finalization API takes not JSContext * but rather either JSFreeOp structure or its library-private counterpart FreeOp. These structures wrap parameters that are passed to the finalizers removing most of explicit dependencies on JSContext in the finalization code.
107 JSFunction API, Guide, JSAPI, NeedsContent, SpiderMonkey
JSFunction is a type in the JSAPI. The APIs JS_NewFunction, JS_DefineFunction, JS_CompileFunction, and their Unicode equivalents return values of type JSFunction *.
108 JSFunctionSpec JSAPI Reference, SpiderMonkey
JSFunctionSpec defines the attributes for a single JS function to associate with an object. An application typically has an array of JSFunctionSpec to define all the functions for an object and calls JS_DefineFunctions or JS_InitClass to create the functions and assign them to an object.
109 JSGetObjectOps JSAPI Reference, Obsolete, SpiderMonkey
JSObjectOps is used by JS_NewObject's internals to discover the set of high-level object operations to use for new objects of the given class. All native objects have a JSClass, which is stored as a private (int-tagged) pointer in object slots. In contrast, all native and host objects have a JSObjectMap at obj->map, which may be shared among a number of objects, and which contains the JSObjectOps *ops pointer used to dispatch object operations from API calls.
110 JSHasInstanceOp JSAPI Reference, Reference, Référence, SpiderMonkey
JSHasInstanceOp is called to 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.
111 JSID_EMPTY JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_EMPTY is an internal jsid value which is used in type inference code.
112 JSID_IS_EMPTY JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_IS_EMPTY tests whether a specified JS ID, id, is JSID_EMPTY.
113 JSID_IS_GCTHING JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_IS_GCTHING tests whether a specified JS ID, id, is a GC thing, and returns true if it's a GC thing.
114 JSID_IS_INT JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_IS_INT tests whether a specified JS ID, id, is an integer, and returns true if it's an integer.
115 JSID_IS_STRING JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_IS_STRING tests whether a specified JS ID, id, is a string, and returns true if it's a string.
116 JSID_IS_SYMBOL JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_IS_SYMBOL tests whether a specified JS ID, id, is a JS Symbol, and returns true if it's a JS Symbol.
117 JSID_IS_VOID JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_IS_VOID tests whether a specified JS ID, id, is JSID_VOID.
118 JSID_IS_ZERO JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_IS_ZERO tests whether a specified JS ID, id, is zero (0 in its integer representation).
119 JSID_VOID JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_VOID does not occur in JS scripts but may be used to indicate the absence of a valid jsid. A void jsid is not a valid id and only arises as an exceptional API return value, such as in JS_NextProperty. Embeddings must not pass JSID_VOID into JSAPI entry points expecting a jsid and do not need to handle JSID_VOID in hooks receiving a jsid except when explicitly noted in the API contract.
120 JSIdArray JSAPI Reference, SpiderMonkey
JSIdArray is used to hold IDs for enumerated properties associated with an object.
121 JSIteratorOp JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
The JavaScript engine calls the JSExtendedClass.iteratorObject callback to create an iterator object for a given object. The callback should return an iterator object or NULL if an error or exception occurred on cx.
122 JSMarkOp JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
Call JS_MarkGCThing for each GC thing directly reachable from obj. Use JSVAL_IS_GCTHING to check whether a value needs to be marked and JSVAL_TO_GCTHING to convert the jsval to a pointer.
123 JSNative JSAPI Reference, SpiderMonkey
JSNative is the type of native implementations of JavaScript functions.  Full documentation of how to define a JSNative (or a JSFastNative, the equivalent typedef which preceded it) is available in the API header "js/CallArgs.h" Added in SpiderMonkey 24.  This header is new, but the semantics it describes are applicable to all recent SpiderMonkey releases.  The preferred way to implement a function is to use the JS::CallArgs structure defined there; the macros providing equivalent functionality are deprecated.
124 JSNewEnumerateOp JSAPI Reference, Reference, Référence, SpiderMonkey
From SpiderMonkey 38, JSNewEnumerateOp is 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.
125 JSNewResolveOp JSAPI Reference, Obsolete, SpiderMonkey
Like JSResolveOp, but flags provide contextual information about the property access.
126 JSObject JSAPI Reference, SpiderMonkey
Objects are made up of the following parts:
127 JSObjectOp JSAPI Reference, Obsolete, SpiderMonkey
The callbacks of this type are:
128 JSObjectOps.defaultValue JSAPI Reference, Obsolete, SpiderMonkey
The JSObjectOps.defaultValue callback corresponds to the [[DefaultValue]] method defined in ECMA 262-3 §8.6.2.6. Many expressions in the ECMAScript language, such as a+b, involve implicit conversion of the operands using [[DefaultValue]].
129 JSObjectOps.defineProperty JSAPI Reference, Obsolete, SpiderMonkey
Define obj[id], an own property of obj named id, having the given initial value, with the specified getter, setter, and attributes.
130 JSObjectOps.destroyObjectMap JSAPI Reference, Obsolete, SpiderMonkey
No summary!
131 JSObjectOps.dropProperty JSAPI Reference, Obsolete, SpiderMonkey
The following contract governs JSObjectOps callers and implementations:
132 JSObjectOps.enumerate JSAPI Reference, Obsolete, SpiderMonkey
For native objects, the enumerate callback first checks the JSCLASS_NEW_ENUMERATE flag of the object's class. If the flag is present, enumerate simply delegates the call to JSClass.enumerate.
133 JSObjectOps.getAttributes JSAPI Reference, Obsolete, SpiderMonkey
Get or set attributes of the property obj[id]. Returns JS_FALSE on error or exception, else JS_TRUE with current attributes in *attrsp. If prop is non-null, it must come from the *propp out parameter of a prior JSObjectOps.defineProperty or JSObjectOps.lookupProperty call.
134 JSObjectOps.getProperty JSAPI Reference, Obsolete, SpiderMonkey
Get, set, or delete obj[id], returning JS_FALSE on error or exception, JS_TRUE on success. If getting or setting, the new value is returned in *vp on success.
135 JSObjectOps.getRequiredSlot JSAPI Reference, Obsolete, SpiderMonkey
Get and set a required slot, one that should already have been allocated. These operations are infallible, so required slots must be pre-allocated, or implementations must suppress out-of-memory errors. The native ops (js_ObjectOps, see js/src/jsobj.c) access slots reserved by including a call to the JSCLASS_HAS_RESERVED_SLOTS(n) macro in the JSClass.flags initializer.
136 JSObjectOps.lookupProperty JSAPI Reference, Obsolete, SpiderMonkey
Look for id in obj and its prototype chain, returning JS_FALSE on error or exception, JS_TRUE on success. On success, return null in *propp if id was not found. If id was found, return the first object searching from obj along its prototype chain in which id names a direct property in *objp, and return a non-null, opaque property pointer in *propp.
137 JSObjectOps.newObjectMap JSAPI Reference, Obsolete, SpiderMonkey
Create a new instance of (a concrete subclass of) JSObjectMap (see jsobj.h), with the nrefs and ops members initialized from the same-named parameters, and with the nslots and freeslot members initialized according to ops and clasp. Return null on error, non-null on success.
138 JSObjectOps.setProto JSAPI Reference, Obsolete, SpiderMonkey
These hooks must check for cycles without deadlocking, and otherwise take special steps. See js_SetPrototype or js_SetParent in js/src/jsobj.c for an example.
139 JSObjectPrincipalsFinder JSAPI Reference, Obsolete, SpiderMonkey
The JavaScript engine calls this callback to obtain principals for a JSPrincipals.subsume check.
140 JSPRINCIPALS_HOLD JSAPI Reference, Obsolete, SpiderMonkey
JSPRINCIPALS_HOLD and JSPRINCIPALS_DROP are used to manage memory for JSPrincipals objects.
141 JSPrincipals JSAPI Reference, Reference, Référence, SpiderMonkey
JSPrincipals is the abstract base class of all principals objects, the objects that identify the source of a function or script and are used to determine its privileges. A principals object is like a Java CodeSource.
142 JSPrincipalsTranscoder
JSPrincipalsTranscoder is the type of a security callback that can be configured using JS_SetPrincipalsTranscoderJSAPI 1.8 and earlier or JS_SetRuntimeSecurityCallbacksAdded in SpiderMonkey 1.8.1.
143 JSProperty JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
JSProperty is the abstract base class of all object properties. It is used internally in JSObjectOps.lookupProperty, getAttributes, setAttributes, and dropProperty.
144 JSPropertyDescriptor JSAPI Reference, Reference, Référence, SpiderMonkey
The JSPropertyDescriptor holds the object that has the property, attributes of the property, getter and setter operations, and the value.
145 JSPropertyOp JSAPI Reference, SpiderMonkey
They are also the types of the JSClass.addProperty, getProperty, and setProperty callbacks, which are called during object property accesses.
146 JSPropertySpec JSAPI Reference, SpiderMonkey
JSPropertySpec defines the attributes for a single JS property to associate with an object. Pass to JS_DefineProperties or JS_InitClass to create the properties and assign them to an object.
147 JSProtoKey JSAPI Reference, Reference, Référence, SpiderMonkey
Each of these types corresponds to standard objects in JavaScript. Some of them are Nightly only (depends on each option).
148 JSReserveSlotsOp JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
JSClass offers the following hook:
149 JSResolveOp JSAPI Reference, Reference, Référence, SpiderMonkey
JSResolveOp callback is a hook which is called when a property is not found on an object.
150 JSRuntime JSAPI Reference, NeedsContent, NeedsUpdate, SpiderMonkey
In the JSAPI, JSRuntime is the top-level object that represents an instance of the JavaScript engine. A program typically has only one JSRuntime, even if it has many threads. The JSRuntime is the universe in which JavaScript objects live; they can't travel to other JSRuntimes.
151 JSSecurityCallbacks.contentSecurityPolicyAllows
Editorial review completed.
152 JSString JSAPI Reference, NeedsContent, SpiderMonkey
Conceptually, a JavaScript string is just an array of char16_t characters and a length. You should not rely on the structure of JSString, because it is subject to change; instead, treat JSString objects as opaque.
153 JSStringFinalizer JSAPI Reference, Reference, Référence, SpiderMonkey
JSStringFinalizer::finalize finalizes external strings created by JS_NewExternalString.
154 JSTraceOp JSAPI Reference, Reference, Référence, SpiderMonkey
JSTraceOp is the 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.
155 JSType JSAPI Reference, SpiderMonkey
No summary!
156 JSVAL_IS_BOOLEAN JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_BOOLEAN(v) is true if the given JavaScript value, v, is a boolean value (that is, it is either JSVAL_TRUE or JSVAL_FALSE).
157 JSVAL_IS_DOUBLE JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_DOUBLE(v) is true if v is a number represented in memory as a jsdouble.
158 JSVAL_IS_GCTHING JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_GCTHING(v) is true if the jsval v is either JSVAL_NULL or a reference to a value that is subject to garbage collection. JavaScript performs automatic garbage collection of objects, strings, and doubles.
159 JSVAL_IS_INT JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_INT(v) is true if the jsval v is a number represented in memory as an integer.
160 JSVAL_IS_NULL JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_NULL(v) is true if v is JSVAL_NULL, which is the JavaScript null value.
161 JSVAL_IS_NUMBER JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_NUMBER(v) is true if v is a JavaScript number.
162 JSVAL_IS_OBJECT JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_OBJECT(v) returns true if v is either an object or JSVAL_NULL. This indicates that it is safe to call JSVAL_TO_OBJECT(v) to convert v to type JSObject *. If v is a string, number, boolean, or undefined, the result is false.
163 JSVAL_IS_PRIMITIVE JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_PRIMITIVE(v) is true if v is undefined, null, a boolean, a number, or a string. Otherwise it is false, and v is an object.
164 JSVAL_IS_STRING JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_STRING(v) is true if v is a string.
165 JSVAL_IS_VOID JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_VOID(v) is true if v is JSVAL_VOID, which represents the JavaScript value undefined.
166 JSVAL_LOCK JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_LOCK is a deprecated feature that is supported only for backward compatibility with existing applications. To lock a value, use local roots with JS_AddRoot.
167 JSVAL_NULL JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_NULL is a jsval constant that represents the JavaScript value null. It is equivalent to OBJECT_TO_JSVAL(NULL).
168 JSVAL_ONE JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_ONE is equivalent to INT_TO_JSVAL(1).
169 JSVAL_TO_BOOLEAN JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_TO_BOOLEAN casts the value v to a C integer, either 0 or 1. As a precondition, JSVAL_IS_BOOLEAN(v) must be true. That is, v must be either JSVAL_TRUE or JSVAL_FALSE. Otherwise the behavior is undefined.
170 JSVAL_TO_DOUBLE JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_TO_DOUBLE casts a specified JS value, v, to a C floating-point number of type jsdouble. As a precondition, JSVAL_IS_DOUBLE(v) must be true. This function is not type-safe: if v is an integer, string, null, or anything else, the behavior is undefined.
171 JSVAL_TO_GCTHING JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_TO_GCTHING casts a jsval, v, to a raw pointer. The type of the result is void *.
172 JSVAL_TO_INT JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_TO_INT converts a specified integer jsval, v, to the corresponding C integer value. If v is any other type of value, the result is unspecified.
173 JSVAL_TO_OBJECT JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_TO_OBJECT casts the argument, v, to type JSObject *. As a precondition, JSVAL_IS_OBJECT(v) must be true. That is, v must be either a reference to an object or JSVAL_NULL. This function is not type-safe: if v is not an object or JSVAL_NULL, the behavior is undefined.
174 JSVAL_TO_STRING JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_TO_STRING casts the argument, v, to type JSString *. As a precondition, JSVAL_IS_STRING(v) must be true. This function is not type-safe: if v is not a string, the behavior is undefined.
175 JSVAL_TRUE JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_TRUE and JSVAL_FALSE are jsval constants that represent the JavaScript boolean values, true and false. They are equivalent to BOOLEAN_TO_JSVAL(true) and BOOLEAN_TO_JSVAL(false), respectively.
176 JSVAL_UNLOCK JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_UNLOCK is a deprecated feature that is supported only for backward compatibility with existing applications. To unlock a value, use local roots with JS_RemoveRoot.
177 JSVAL_VOID JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_VOID is a jsval constant that represents the JavaScript value undefined.
178 JSVAL_ZERO JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_ZERO is equivalent to INT_TO_JSVAL(0).
179 JSVersion JSAPI Reference, SpiderMonkey
The JSVersion enumerated type includes the following values. Each version has a name, which is a string used by JS_StringToVersion and JS_VersionToString.
180 JSXDRObjectOp JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
Serialize or deserialize an object, given an XDR state record representing external data. See jsxdrapi.h.
181 JS_ASSERT_STRING_IS_FLAT JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ASSERT_STRING_IS_FLAT asserts the string is flattened, and returns a pointer to JSFlatString.
182 JS_Add*Root JSAPI Reference, Obsolete, SpiderMonkey
These functions are obsoleted, use JS::PersistentRooted instead.
183 JS_AddArgumentFormatter JSAPI Reference, Obsolete, SpiderMonkey
JS_AddArgumentFormatter establishes formatter as the conversion function for format strings beginning with format in the context cx. On success, it returns JS_TRUE. Otherwise it returns JS_FALSE. (At the moment, JS_AddArgumentFormatter fails only if there is no memory available to record the registration.)
184 JS_AddExternalStringFinalizer JSAPI Reference, Obsolete, SpiderMonkey
Add a finalizer for external strings created by JS_NewExternalString using a type-code returned from this function, and that understands how to free or release the memory pointed at by JS_GetStringChars(str).
185 JS_AddFinalizeCallback JSAPI Reference, Reference, Référence, SpiderMonkey
JS_AddFinalizeCallback add a callback function which the garbage collector calls at several points during garbage collection. rt is the runtime in which you specify the callback. cb is a pointer to the callback function to add.
186 JS_AliasElement JSAPI Reference, Obsolete, SpiderMonkey
JS_AliasElement assigns an alternate index number for an element or numeric property associated with a native object. obj is the object to which the element belongs. name is the element's current index in the object, and alias is the alternate index to assign to the element.
187 JS_AliasProperty JSAPI Reference, Obsolete, SpiderMonkey
JS_AliasProperty assigns an alternate name for a property associated with a native object. obj is the object to which the property belongs. name is the property's current name in the object, and alias is the alternate name to assign to the property.
188 JS_AlreadyHasOwnProperty JSAPI Reference, SpiderMonkey
These functions attempt to determine whether a property already exists on a specific JSObject without modifying the object. By design, this search may not find a property that other property lookup functions, such as JS_LookupProperty, would find.
189 JS_BeginRequest JSAPI Reference, SpiderMonkey
Indicates to the JS engine that the calling thread is entering a region of code that may call into the JSAPI but does not block.
190 JS_BindCallable JSAPI Reference, Reference, Référence, SpiderMonkey
JS_BindCallable binds the given callable to use the given object as this.
191 JS_BufferIsCompilableUnit JSAPI Reference, SpiderMonkey
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.
192 JS_CStringsAreUTF8 JSAPI Reference, Obsolete, SpiderMonkey
By default, all C/C++ strings passed into the JSAPI are treated as ISO/IEC 8859-1, also known as ISO-Latin-1. That is, each byte is treated as a Unicode character, and there is no way to pass in a string containing characters beyond U+00FF.
193 JS_CallFunction JSAPI Reference, SpiderMonkey
Calls a specified JS function.
194 JS_CheckAccess JSAPI Reference, SpiderMonkey
Check whether a running script may access a given object property.
195 JS_CheckForInterrupt JSAPI_Reference, Reference, Référence, SpiderMonkey
JS_CheckForInterrupt checks for the interrupt, and handle it if it's pending. JS_CheckForInterrupt returns false if interrupt callback returns false.
196 JS_ClearContextThread JSAPI Reference, SpiderMonkey
Transfer a JSContext from one thread to another.
197 JS_ClearDateCaches Date, JSAPI Reference, JavaScript, Reference, Référence, SpiderMonkey
JS_ClearDateCaches clears the cache of calculated local time from each Date object. Call to propagate a system timezone change.
198 JS_ClearNewbornRoots JSAPI Reference, SpiderMonkey
The last GC thing of each type (object, string, double, external string types) created on a given context is kept alive until another thing of the same type is created, using a newborn root in the context. These newborn roots help native code protect newly-created GC-things from GC invocations activated before those things can be rooted using local or global roots.
199 JS_ClearNonGlobalObject JSAPI Reference, Obsolete, SpiderMonkey
JS_ClearNonGlobalObject removes all of obj's own properties, except the special __proto__ and __parent__ properties, in a single operation. Properties belonging to objects on obj's prototype chain are not affected.
200 JS_ClearPendingException JSAPI Reference, SpiderMonkey
JS_ClearPendingException cancels the currently pending exception in cx, if any. (There is a pending exception if the most recently thrown exception in cx has not yet been caught or cleared.)
201 JS_ClearRegExpStatics JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ClearRegExpStatics clears the pending input string and flags of the built-in RegExp object.
202 JS_ClearScope JSAPI Reference, Obsolete, SpiderMonkey
JS_ClearScope removes all of obj's own properties, except the special __proto__ and __parent__ properties, in a single operation. Properties belonging to objects on obj's prototype chain are not affected.
203 JS_CloneFunctionObject JSAPI Reference, SpiderMonkey
JS_CloneFunctionObject creates a new function object from funobj. The new object has the same code and argument list as funobj, but uses parent as its enclosing scope. This can be helpful if funobj is an extant function that you wish to use as if it were enclosed by a newly-created global object.
204 JS_CompareStrings JSAPI Reference, SpiderMonkey
JS_CompareStrings compares two JS strings, str1 and str2. If the strings are identical in content and length, JS_CompareStrings stores 0 in *result. If str1 is less than str2, *result is less than 0. If str1 is greater than str2, *result is greater than 0.
205 JS_CompileFileHandleForPrincipals JSAPI Reference, NeedsContent, Obsolete, SpiderMonkey
Please provide a description of this function.
206 JS_CompileFileHandleForPrincipalsVersion JSAPI Reference, NeedsContent, Obsolete, SpiderMonkey
Please provide a description for this function.
207 JS_CompileFunction JSAPI Reference, SpiderMonkey
JS_CompileFunction compiles a function from a text string, bytes, and optionally associates it with a JS object, obj. JS_CompileUCFunction is the Unicode version of the function.
208 JS_CompileFunctionForPrincipals JSAPI Reference, Obsolete, SpiderMonkey
JS_CompileFunctionForPrincipals compiles a security-enabled function from a text string, bytes, and associates it with a JS object, obj. JS_CompileUCFunctionForPrincipals is the Unicode version of the function.
209 JS_CompileScript JSAPI Reference, SpiderMonkey
JS_CompileScript compiles a script, source, for execution. JS_CompileUCScript is the Unicode version of the function.
210 JS_CompileScriptForPrincipals JSAPI Reference, Obsolete, SpiderMonkey
JS_CompileScriptForPrincipals compiles a security-enabled script, src, for execution. JS_CompileUCScriptForPrincipals is the Unicode version of the function. The script is associated with a JS object.
211 JS_CompileUCFunctionForPrincipalsVersion JSAPI Reference, NeedsContent, Obsolete, SpiderMonkey
Please provide a description for this function.
212 JS_CompileUTF8File JSAPI Reference, Obsolete, SpiderMonkey
JS_CompileUTF8File compiles the text of script in an external file location for execution by the JS engine. filename is the name of the file containing the script to compile.
213 JS_CompileUTF8FileHandle JSAPI Reference, Obsolete, SpiderMonkey
No summary!
214 JS_ConcatStrings JSAPI, JSAPI Reference, SpiderMonkey
JS_ConcatStrings concatenates two JS strings, str1 and str2, and returns the result. The result could be the same as one of the input strings, if the other string is zero length. When the string concatenation fails NULL is returned.
215 JS_ConstructObject JSAPI Reference, Obsolete, SpiderMonkey
JS_ConstructObject creates a new object of the specified class, with the specified prototype and parent, then invokes a constructor function to initialize the new object. cx is a pointer to a context associated with the runtime in which to create the new object. clasp is a pointer to the class of object to create. proto and parent may specify objects to be used as the new object's prototype and parent. If either is NULL, the engine tries to find reasonable defaults.
216 JS_ContextIterator JSAPI Reference, SpiderMonkey
JS_ContextIterator steps through the set of contexts associated with the runtime rt. Each call to JS_ContextIterator returns the next context in the cycle.
217 JS_ConvertArguments JSAPI Reference, Obsolete, SpiderMonkey
JS_ConvertArguments provides a convenient way to translate a series of JS values into their corresponding JS types with a single function call. It saves you from having to write separate tests and elaborate if...else statements in your function code to retrieve and translate multiple JS values for use with your own functions.
218 JS_ConvertArgumentsVA JSAPI Reference, Obsolete, SpiderMonkey
JS_ConvertArgumentsVA is to JS_ConvertArguments as vprintf is to printf. See JS_ConvertArguments for further information.
219 JS_ConvertValue JSAPI Reference, Obsolete, SpiderMonkey
JS_ConvertValue converts a JavaScript value, v, to the specified type. On success, the converted value is stored in *vp. Typically users of this function set vp to point to v, so that if conversion is successful, v now contains the converted value.
220 JS_DecompileFunction JSAPI Reference, SpiderMonkey
JS_DecompileFunction generates the complete source code of a function declaration from a function's compiled form, fun.
221 JS_DecompileFunctionBody JSAPI Reference, SpiderMonkey
JS_DecompileFunctionBody generates the source code of a function's body, minus the function keyword, name, parameters, and braces, from a function's compiled form, fun.
222 JS_DecompileScript JSAPI Reference, Reference, Référence, SpiderMonkey
JS_DecompileScript returns the source code of script. If script is a function, it calls JS_DecompileFunction. Otherwise, it returns the original source code of the script. If the script is not cached, it tries to load the source from file, and returns nullptr if an error happened while loading.
223 JS_DecompileScriptObject JSAPI Reference, NeedsContent, SpiderMonkey
FIXME: Please provide a description for this function.
224 JS_DeepFreezeObject JSAPI Reference, Reference, Référence, SpiderMonkey
JS_DeepFreezeObject freezes 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.
225 JS_DefaultValue JSAPI Reference, SpiderMonkey
Renamed to JS::ToPrimitive from JSAPI 44.
226 JS_DefineConstDoubles JSAPI Reference, SpiderMonkey
JS_DefineConstDoubles creates one or more properties for a specified object, obj, where each property consists of a double value.
227 JS_DefineElement JSAPI Reference, SpiderMonkey
JS_DefineElement defines a numeric property for a specified object, obj.
228 JS_DefineFunction JSAPI Reference, SpiderMonkey
JS_DefineFunction exposes a C/C++ function to scripts by defining a new method on an existing JavaScript object. It creates the new Function object as though by calling JS_NewFunction, then makes it a method of obj as though by calling JS_DefineProperty. JS_DefineUCFunction is the Unicode version of the function.
229 JS_DefineFunctions JSAPI Reference, Reference, Référence, SpiderMonkey
JS_DefineFunctions creates zero or more functions and makes them properties (methods) of a specified object, obj, as if by calling JS_DefineFunction repeatedly.
230 JS_DefineObject JSAPI Reference, SpiderMonkey
JS_DefineObject creates a new object of the class clasp and assigns it to a new property of an existing object, obj. name is the property name to assign to obj to hold the new object, and flags contains the property attributes to set for the newly created property.
231 JS_DefineOwnProperty JSAPI Reference, Obsolete, SpiderMonkey
JS_DefineOwnProperty implements the ECMAScript defined function Object.defineProperty. So the same restrictions apply as for that function (e.g. it is not possible to change a non-configurable property).
232 JS_DefineProperties JSAPI Reference, SpiderMonkey
JS_DefineProperties creates properties on a specified object, obj.
233 JS_DefineProperty JSAPI Reference, SpiderMonkey
JS_DefineProperty defines a single property in a specified object, obj. JS_DefineUCProperty is the Unicode version of the function. JS_DefinePropertyById is the same but takes a JS::HandleId for the property name.
234 JS_DefinePropertyWithTinyId JSAPI Reference, Obsolete, SpiderMonkey
JS_DefinePropertyWithTinyId defines an object property with a tiny id. JS_DefineUCPropertyWithTinyId is the Unicode version of the function. Except for the tinyid parameter, these functions behave exactly as JS_DefineProperty and JS_DefineUCProperty. See those functions for more details.
235 JS_DeleteElement JSAPI Reference, SpiderMonkey
JS_DeleteElement removes a specified element or numeric property, index, from an object, obj. If an object references an element belonging to a prototype, the element reference is removed from the object, but the prototype's element is not deleted. If deletion is successful, JS_DeleteElement returns true. Otherwise it returns false.
236 JS_DeleteElement2 JSAPI Reference, Obsolete, SpiderMonkey
JS_DeleteElement2 removes a specified numeric property, index, from an object, obj. If obj inherits the specified property from a prototype, the property is removed from the object, but not from the prototype. If deletion is successful, JS_DeleteElement2 stores true to *succeeded and returns true. Otherwise it returns false and the value of *succeeded is undefined.
237 JS_DeleteProperty JSAPI Reference, SpiderMonkey
JS_DeleteProperty removes a specified property, name, from an object, obj. JS_DeletePropertyById is the same but takes a jsid for the property name. These functions are identical to JS_DeleteProperty2 and JS_DeletePropertyById2 except that they do not have an out parameter.
238 JS_DeleteProperty2 JSAPI Reference, Obsolete, SpiderMonkey
JS_DeleteProperty2 removes a specified property, name, from an object, obj, and stores true or false in *succeeded. It behaves like the JavaScript expression delete obj[name]. JS_DeleteUCProperty2 is the Unicode version of the function. JS_DeletePropertyById2 is the same but takes a JS::HandleId for the property name.
239 JS_DestroyContext JSAPI Reference, SpiderMonkey
These functions destroy a context, cx. JS_DestroyContext additionally performs garbage collection to reclaim any memory that was being used by cx's global object. JS_DestroyContextNoGC does not perform garbage collection. JS_DestroyContextMaybeGC may or may not perform garbage collection; the engine makes an educated guess as to whether enough memory would be reclaimed to justify the work.
240 JS_DestroyIdArray JSAPI Reference, SpiderMonkey
JS_DestroyIdArray frees the ID array pointed to by ida.
241 JS_DestroyRuntime JSAPI Reference, SpiderMonkey
JS_DestroyRuntime frees the specified the JavaScript runtime environment, rt. Call JS_DestroyRuntime after completing all other JS API calls. JS_DestroyRuntime garbage collects and frees the memory previously allocated by JS_NewRuntime.
242 JS_DestroyScript JSAPI Reference, Obsolete, SpiderMonkey
JS_DestroyScript destroys the given compiled script, freeing the memory allocated to it. The script must not be currently executing (in any context, at any level of the stack) and must not be used again afterwards.
243 JS_DoubleIsInt32 JSAPI Reference, SpiderMonkey
JS_DoubleIsInt32 returns true if d i sequal to *ip.
244 JS_DoubleToInt32 JSAPI Reference, Obsolete, SpiderMonkey
JS_DoubleToInt32 converts a C floating-point number of type double to int32, a signed 32-bit integer.
245 JS_DropExceptionState JSAPI Reference, SpiderMonkey
This function destroys the specified JSExceptionState object, unrooting as necessary any attached exception object and freeing the memory resources associated with the JSExceptionState object.
246 JS_DumpHeap JSAPI Reference, Obsolete, SpiderMonkey
See bug 378261 for detail.
247 JS_DumpNamedRoots JSAPI Reference, Obsolete, SpiderMonkey
Each call to JS_AddNamedRoot creates a record in a table of named roots maintained by the garbage collector. JS_DumpNamedRoots provides a way for the application to access the contents of that table. It calls the dump function once for each named root in the given runtime rt. In pseudocode:
248 JS_EncodeCharacters JSAPI Reference, Obsolete, SpiderMonkey
JS_EncodeCharacters copies the characters of a jschar array into a char array, converting the 16-bit values to 8-bit values. If SpiderMonkey was built with JS_C_STRINGS_ARE_UTF8 defined or JS_SetCStringsAreUTF8 was called, the string is converted to UTF-8.  Otherwise each character is simply truncated to 8 bits.
249 JS_EncodeString JSAPI Reference, Reference, Référence, SpiderMonkey
JS_EncodeString and JS_EncodeStringToUTF8 convert the specified JavaScript str to a C string (an array of 8-bit chars).
250 JS_EncodeStringToBuffer JSAPI Reference, Reference, Référence, SpiderMonkey
JS_EncodeStringToBuffer converts the specified JavaScript str to a C string (an array of 8-bit chars) and fills the specified buffer with up to length bytes of the string. It returns the length of the whole string encoding or (size_t)-1 if the string can't be encoded as bytes. If the returned value is greater than the length you specified, the string was truncated.
251 JS_EnterCompartment JSAPI Reference, SpiderMonkey
No summary!
252 JS_EnterCrossCompartmentCall JSAPI Reference, Obsolete, SpiderMonkey
No summary!
253 JS_EnterLocalRootScope JSAPI Reference, Obsolete, SpiderMonkey
Scoped local root management allows native functions, getter/setters, etc. to avoid calling JS_AddRoot and JS_RemoveRoot to manage global roots temporarily.
254 JS_Enumerate JSAPI Reference, SpiderMonkey
JS_Enumerate gets the ids of all own properties of the specified object, obj, that have the JSPROP_ENUMERATE attribute. (The term own property refers to a property that is not inherited from the object's prototype.) This is not quite the same behavior as a JavaScript for...in loop, which converts all property ids to strings and also enumerates inherited properties.
255 JS_EnumerateDiagnosticMemoryRegions JSAPI Reference, Reference, Référence, SpiderMonkey
JS_EnumerateDiagnosticMemoryRegions enumerates memory regions that contain diagnostic information intended to be included in crash report minidumps.
256 JS_EnumerateResolvedStandardClasses JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
JS_EnumerateResolvedStandardClasses enumerates any already-resolved standard class ids into ida, or into a new JSIdArray if ida is NULL. Return the augmented array on success, NULL on failure with ida (if it was non-null on entry) destroyed.
257 JS_EnumerateStandardClasses JSAPI Reference, Reference, Référence, SpiderMonkey
The global object's class's enumerate op should call JS_EnumerateStandardClasses(cx, obj), to define eagerly during for...in loops any classes not yet resolved lazily.
258 JS_ErrorFromException JSAPI Reference, Reference, Référence, SpiderMonkey
If obj is an exception object, the exception will have (or be able to lazily create) an error report struct, and JS_ErrorFromException 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.
259 JS_EvaluateScript JSAPI Reference, Obsolete, SpiderMonkey
JS_EvaluateScript compiles and executes a script in the specified scope, obj. JS_EvaluateUCScript is the Unicode version of the function.
260 JS_EvaluateScriptForPrincipals JSAPI Reference, Obsolete, SpiderMonkey
No summary!
261 JS_ExecuteRegExp JSAPI Reference, SpiderMonkey
JS_ExecuteRegExp and JS_NewRegExpObjectNoStatics execute the RegExp object, reobj, to the specified input string, chars, from *indexp index.
262 JS_ExecuteScript JSAPI Reference, SpiderMonkey
JS_ExecuteScript executes a previously-compiled script, script.
263 JS_ExecuteScriptPart JSAPI Reference, Obsolete, SpiderMonkey
JS_ExecuteScriptPart executes part of a previously compiled script, script. The part parameter must be either JSEXEC_PROLOG to execute the script prolog or JSEXEC_MAIN to execute the main section of the script.
264 JS_ExecuteScriptVersion JSAPI Reference, Obsolete, SpiderMonkey
JS_ExecuteScript executes a previously-compiled script, script.
265 JS_FORGET_STRING_FLATNESS JSAPI Reference, Reference, Référence, SpiderMonkey
JS_FORGET_STRING_FLATNESS converts JSFlatString * to JSString *.
266 JS_FS JSAPI Reference, SpiderMonkey
Use these macros to define an array of JSFunctionSpecs to pass to JS_DefineFunctions or JS_InitClass.
267 JS_FileEscapedString JSAPI Reference, Reference, Référence, SpiderMonkey
JS_FileEscapedString writes str into file fp escaping any non-printable or non-ASCII character. If quote is not 0, it must be a single or double quote character that will quote the output.
268 JS_Finish JSAPI Reference, Obsolete, SpiderMonkey
JS_Finish is obsolete. Use JS_DestroyRuntime instead.
269 JS_FlattenString JSAPI, JSAPI Reference, Reference, Référence, SpiderMonkey
JS_FlattenString flattens a string str and returns a pointer to JSFlatString.
270 JS_FlushCaches JSAPI Reference, NeedsContent, SpiderMonkey
.
271 JS_ForgetLocalRoot JSAPI Reference, Obsolete, SpiderMonkey
This function is used to interact with scoped local root management. See JS_EnterLocalRootScope for more on this topic.
272 JS_ForwardGetPropertyTo JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ForwardGetPropertyTo is the base implementation of JS_GetProperty, JS_GetUCProperty, JS_GetPropertyById etc, where onBehalfOf is same to obj.
273 JS_FreezeObject JSAPI Reference, Reference, Référence, SpiderMonkey
Freezes an object. This means that other code cannot delete, add or change any properties on the object. See ES5's Object.freeze method.
274 JS_GC JSAPI Reference, SpiderMonkey
JS_GC performs garbage collection of JS objects, strings and other internal data structures that are no longer reachable in the specified context or runtime. Garbage collection frees memory so that it can be reused by the system.
275 JS_GET_CLASS JSAPI Reference, Obsolete, SpiderMonkey
JS_GET_CLASS returns a pointer to the JSClass associated with a specified JS object, obj. The application must treat the JSClass as read-only.
276 JS_GetArrayLength JSAPI Reference, SpiderMonkey
JS_GetArrayLength gets the .length property of obj as though by calling JS_GetProperty and converts it to a 32-bit unsigned integer. If obj is an array (see JS_IsArrayObject), this is guaranteed to succeed, because the .length property of an array is always a number and can't be deleted or redefined.
277 JS_GetArrayPrototype JSAPI Reference, SpiderMonkey
JS_GetArrayPrototype() retrieves the original Array.prototype of a specified object, obj.  If an error occurs, it returns NULL.
278 JS_GetClass JSAPI Reference, SpiderMonkey
JS_GetClass returns a pointer to the JSClass associated with a specified JS object, obj. The application must treat the JSClass as read-only. If obj has no JSClass, this returns NULL.
279 JS_GetClassObject JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetClassObject gets the builtin class costructor for the specified prototype key.
280 JS_GetClassPrototype JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetClassPrototype gets the builtin class costructor for the specified prototype key.
281 JS_GetCompartmentPrivate JSAPI Reference, SpiderMonkey
Please provide a description for this function.
282 JS_GetConstructor JSAPI Reference, SpiderMonkey
JS_GetConstructor retrieves the constructor property of a given object, obj. If the result is a Function object, JS_GetConstructor returns a pointer to that object. Otherwise, it reports an error and returns NULL.
283 JS_GetContextPrivate JSAPI Reference, SpiderMonkey
Each JSContext has two fields of type void * which the application may use for any purpose. They are especially useful for storing data needed by callbacks. JS_GetContextPrivate and JS_GetSecondContextPrivate get this field and JS_SetContextPrivate and JS_SetSecondContextPrivate set it. The field is initially NULL.
284 JS_GetContextThread JSAPI Reference, SpiderMonkey
Returns the ID of the associated thread for a context.
285 JS_GetDefaultFreeOp JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetDefaultFreeOp returns default JSFreeOp for the runtime.
286 JS_GetElement JSAPI Reference, SpiderMonkey
JS_GetElement examines a specified JS object, obj, and its prototype chain, for an element or numeric property numbered index.
287 JS_GetEmptyString JSAPI, JSAPI Reference, Reference, Référence, SpiderMonkey
The returned empty string has the length 0.
288 JS_GetEmptyStringValue JSAPI Reference, SpiderMonkey
JS_GetEmptyStringValue returns the empty string as a JS::Value.
289 JS_GetErrorPrototype JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetErrorPrototype returns the original value of Error.prototype from the global object of the current compartment of cx.
290 JS_GetExternalStringClosure JSAPI, JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
To determine if a string was created as an external string, you can call JS_IsExternalString.
291 JS_GetExternalStringFinalizer JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetExternalStringFinalizer returns the fin parameter passed to JS_NewExternalString.
292 JS_GetFlatStringChars JSAPI, JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
No summary!
293 JS_GetFunctionArity JSAPI Reference, SpiderMonkey
JS_GetFunctionArity returns the number of formal parameters of a function, fun. This is the same as the function object's arity property, if that property has not been overwritten. Specifically, if fun is a native function, the result is the value that was passed to the nargs parameter of JS_DefineFunction. Otherwise fun is implemented in JavaScript, and the result is the number of identifiers in its formal parameter list (see ECMA 262-3 §13).
294 JS_GetFunctionCallback JSAPI Reference, Obsolete, SpiderMonkey
Returns the callback currently configured to be called when JavaScript functions are invoked or exited, as established by a prior call to JS_SetFunctionCallback.
295 JS_GetFunctionFlags JSAPI Reference, Obsolete, SpiderMonkey
JS_GetFunctionFlags retrieves the function flags of a given JavaScript function, fun. These flags are for the JavaScript engine’s internal use. Most applications can’t do anything useful with them.
296 JS_GetFunctionId JSAPI Reference, SpiderMonkey
JS_GetFunctionId returns the name of a function, fun, 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.
297 JS_GetFunctionName JSAPI Reference, Obsolete, SpiderMonkey
JS_GetFunctionName retrieves the function name associated with a function pointer, fun. The return value is either the name of a function, or the string "anonymous", which indicates that the function was not assigned a name when created.
298 JS_GetFunctionObject JSAPI Reference, SpiderMonkey
JS_GetFunctionObject returns the JavaScript Function object for a specified function pointer, fun.
299 JS_GetFunctionPrototype JSAPI Reference, SpiderMonkey
JS_GetFunctionPrototype() retrieves the original Function.prototype of a specified object, obj.  If an error occurs, it returns NULL.
300 JS_GetFunctionScript JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetFunctionScript returns a pointer to JSScript for the specified function, fun. If fun is a native function, it returns NULL.
301 JS_GetGCParameter JSAPI Reference, SpiderMonkey
JS_GetGCParameter returns the current parameter of the garbage collection.
302 JS_GetGlobalForCompartmentOrNull JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetGlobalForCompartmentOrNull() returns the global object for the context and the compartment. This may return NULL if c never had a global (e.g., the atoms compartment), or if c's global has been collected.
303 JS_GetGlobalForObject JSAPI Reference, SpiderMonkey
JS_GetGlobalForObject returns the last non-null object on the parent chain of the input object.
304 JS_GetGlobalForObject3
This page was auto-generated because a user created a sub-page to this page.
305 JS_GetGlobalForScopeChain JSAPI Reference, Obsolete, SpiderMonkey
JS_GetGlobalForScopeChain() returns the global object for whatever function is currently running on the context. In other words, it returns the global object on the current scope chain.
306 JS_GetGlobalObject JSAPI Reference, Obsolete, SpiderMonkey
This function is obsolete: use JS_GetGlobalForObject or JS_GetGlobalForScopeChain instead. The concept of a global object belonging to a context will likely be phased out in future versions of SpiderMonkey.
307 JS_GetImplementationVersion JSAPI Reference, SpiderMonkey
JS_GetImplementationVersion returns a hard-coded, English language string that specifies the version number of the JS engine currently in use, and its release date.
308 JS_GetInstancePrivate JSAPI Reference, SpiderMonkey
JS_GetInstancePrivate determines if a JavaScript object, obj, is an instance of a given JSClass, clasp, and if it is, returns a pointer to the object's private data. Otherwise it returns NULL.
309 JS_GetInternedStringChars JSAPI Reference, Obsolete, SpiderMonkey
JS_GetInternedStringChars returns a pointer to the interned string.
310 JS_GetLatin1FlatStringChars JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetLatin1FlatStringChars and JS_GetTwoByteFlatStringChars return a pointer to the string.
311 JS_GetLatin1InternedStringChars JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetLatin1InternedStringChars and JS_GetTwoByteInternedStringChars gets the characters of the string, str.
312 JS_GetLatin1StringCharsAndLength JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetLatin1StringCharsAndLength and JS_GetTwoByteStringCharsAndLength get the characters and the length of the string, str.
313 JS_GetLocaleCallbacks JSAPI Reference, SpiderMonkey
JS_SetLocaleCallbacks establishes locale callbacks. The pointer must persist as long as the JSRuntime. Passing nullptr restores the default behaviour.
314 JS_GetNaNValue JSAPI Reference, SpiderMonkey
JS_GetNaNValue returns a value of type JS::Value that represents an IEEE floating-point quiet Not-a-Number (NaN).
315 JS_GetObjectPrototype JSAPI Reference, SpiderMonkey
JS_GetObjectPrototype() retrieves the original Object.prototype of a specified object, obj.  If an error occurs, it returns NULL.
316 JS_GetObjectRuntime JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetObjectRuntime retrieves a pointer to the JSRuntime for a specified JSObject.
317 JS_GetOptions JSAPI Reference, Obsolete, SpiderMonkey
JS_GetOptions retrieves the option flags of a given JS context cx.
318 JS_GetOwnPropertyDescriptor JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetOwnPropertyDescriptor and JS_GetOwnPropertyDescriptorById get a detailed description of that property (returned in desc->obj). If desc->obj is null, then this property was not found on the prototype chain.
319 JS_GetParent JSAPI Reference, Obsolete, SpiderMonkey
JS_GetParent retrieves the parent object of obj, or NULL if obj does not have a parent.
320 JS_GetParentRuntime JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetParentRuntime retrieves a pointer to the parent JSRuntime of the runtime for a specified JSContext. If the cx's runtime has no parent runtime, JS_GetParentRuntime returns cx's runtime itself.
321 JS_GetPendingException JSAPI Reference, SpiderMonkey
If an exception has been thrown in the context cx, and it has not yet been caught or cleared, JS_GetPendingException stores the exception object in *vp and returns true.
322 JS_GetPositiveInfinityValue JSAPI Reference, SpiderMonkey
JS_GetPositiveInfinityValue returns a JS::Value that represents an IEEE floating-point positive infinity. JS_GetNegativeInfinityValue returns the corresponding negative infinity.
323 JS_GetPrivate JSAPI Reference, SpiderMonkey
JS_GetPrivate accesses an object's private data field. obj must be an instance of a class that has the JSCLASS_HAS_PRIVATE flag.
324 JS_GetProperty JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetProperty examines a specified JS object obj and its prototype chain for a property with the specified name. It behaves like the JavaScript expression obj[name]. JS_GetUCProperty is the Unicode version of the function. JS_GetPropertyById is the same but takes a JS::HandleId for the property name.
325 JS_GetPropertyAttributes JSAPI Reference, Obsolete, SpiderMonkey
JS_GetPropertyAttributes retrieves the property attributes of the property with the given name on a given object, obj. JS_GetUCPropertyAttributes is the Unicode version of the function.
326 JS_GetPropertyAttrsGetterAndSetter JSAPI Reference, Obsolete, SpiderMonkey
See JS_GetPropertyAttributes for details about these functions. The only difference is that on success, these functions also get the getter and setter functions for the property.
327 JS_GetPropertyDefault JSAPI Reference, Obsolete, SpiderMonkey
JS_GetPropertyDefault examines a specified JS object obj and its prototype chain for a property with the specified name.
328 JS_GetPropertyDescriptor JSAPI Reference, SpiderMonkey
JS_GetPropertyDescriptor and JS_GetPropertyDescriptorById find a specified property of an object and gets a detailed description of that property on the prototype chain (returned in desc->obj). If desc->obj is null, then this property was not found on the prototype chain.
329 JS_GetPrototype JSAPI Reference, SpiderMonkey
JS_GetPrototype retrieves the prototype of a specified object, obj. A prototype object provides properties inherited by similar JS objects. This is the equivalent of Object.getPrototypeOf(obj) from javascript.
330 JS_GetRegExpFlags JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetRegExpFlags returns flags of the specified object, obj.
331 JS_GetRegExpSource JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetRegExpSource returns a source string of the specified object, obj.
332 JS_GetReservedSlot JSAPI Reference, SpiderMonkey
If a JSClass has JSCLASS_HAS_RESERVED_SLOTS(n) in its flags, with n > 0, or has a non-null JSClass.reserveSlots callback, then objects of that class have n reserved slots in which the application may store data. These fields are not directly exposed to scripts.
333 JS_GetRuntime JSAPI Reference, SpiderMonkey
JS_GetRuntime retrieves a pointer to the JSRuntime with which a specified JSContext, cx, is associated. Each context is associated with a particular JSRuntime when it is created (see JS_NewContext); JS_GetRuntime provides a convenient, programmatic way to look up the association.
334 JS_GetRuntimePrivate JSAPI Reference, SpiderMonkey
Each JSRuntime has a field of type void * which the application may use for any purpose. It is especially useful for storing data which callbacks may then easily access. JS_GetRuntimePrivate gets the value of this field and JS_SetRuntimePrivate sets it. The field is initially NULL.
335 JS_GetScopeChain JSAPI Reference, Obsolete, SpiderMonkey
JS_GetScopeChain returns the first JSObject on the scope chain for the JavaScript code currently running in the given context, cx.
336 JS_GetSecurityCallbacks JSAPI Reference, SpiderMonkey
JS_SetSecurityCallbacks sets the runtime's security callbacks to callbacks. It allows the embedding to control certain aspects of JS code execution based on security settings of the global object the code is executed in. If callbacks is NULL, it sets callbacks to default value.
337 JS_GetStringBytes JSAPI Reference, Obsolete, SpiderMonkey
JS_GetStringBytes and JS_GetStringBytesZ convert the specified JavaScript string, str, to a C string (an array of 8-bit chars). If JS_CStringsAreUTF8 is true, then the returned string is UTF-8, and the conversion is lossless. Otherwise the high byte is simply dropped from each jschar. On success, the return value is a pointer to the char array, which is null-terminated. On failure, JS_GetStringBytes returns a pointer to a null-terminated empty string; JS_GetStringBytesZ returns NULL.
338 JS_GetStringCharAt JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetStringCharAt and JS_GetFlatStringCharAt get the specified character from the string str.
339 JS_GetStringChars JSAPI Reference, Obsolete, SpiderMonkey
JS_GetStringChars Obsolete since JavaScript 1.8.5 returns a pointer to the first element of an array of jschars. Warnings:
340 JS_GetStringCharsAndLength JSAPI Reference, Obsolete, SpiderMonkey
JS_GetStringCharsAndLength gets the characters and the length of the string, str
341 JS_GetStringEncodingLength JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetStringEncodingLength returns the length of the specified string in bytes, regardless of its encoding. You can use this value to create a buffer to encode the string into using the JS_EncodeStringToBuffer function.
342 JS_GetStringLength JSAPI Reference, SpiderMonkey
JS_GetStringLength reports the length, in 16-bit code units, of the string str. This is the same as the length property of the string. This is the same as the length of the array returned by JS_GetStringChars, in char16_ts (not bytes).
343 JS_GetTwoByteExternalStringChars JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetTwoByteExternalStringChars gets the characters of the string, str.
344 JS_GetTypeName JSAPI Reference, Obsolete, SpiderMonkey
JS_GetTypeName returns a pointer to a string literal description of a specified JS data type, type. The following table lists JSTypes and the string literals reported by JS_GetTypeName:
345 JS_GetVersion JSAPI Reference, SpiderMonkey
JS_GetVersion returns the JavaScript version currently used by the given JSContext, cx. The result is one of the JSVersion constants.
346 JS_HasArrayLength JSAPI Reference, Obsolete, SpiderMonkey
JS_HasArrayLength determines if an object, obj, has a length property. If the property exists, JS_HasArrayLength stores the current value of the property in *lengthp.
347 JS_HasElement JSAPI Reference, Reference, Référence, SpiderMonkey
JS_HasElement examines a specified JS object, obj, and its prototype chain, for an element or numeric property numbered index.
348 JS_HasInstance JSAPI Reference, Reference, Référence, SpiderMonkey
JS_HasInstance determines if a specified JS value, v, is an instance of JS object, obj. This function is equivalent to v instanceof obj test in JavaScript. On success, JS_HasInstance stores the result of the instanceof test in *bp and returns true. On error or exception, it returns false, and the value left in *bp is undefined.
349 JS_HasOwnProperty JSAPI Reference, SpiderMonkey
Editorial review completed.
350 JS_HasProperty JSAPI Reference, SpiderMonkey
JS_HasProperty searches an object, obj, and its prototype chain, for a property with the specified name. It behaves like the JavaScript expression name in obj. JS_HasUCProperty is the corresponding Unicode API. JS_HasPropertyById is the same but takes a JS::HandleId for the property name.
351 JS_IdArrayGet JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IdArrayGet gets the item in the specified index of the ID array pointed to by ida.
352 JS_IdArrayLength JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IdArrayLength gets the length of the ID array pointed to by ida.
353 JS_IdToProtoKey JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IdToProtoKey converts a specified JS ID, id, to a prototype key. On success, JS_IdToProtoKey returns a JSProtoKey. Otherwise it returns JSProto_Null.
354 JS_IdToValue JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IdToValue converts a specified JS ID, id, to a JS value. On success, JS_IdToValue stores the converted value in *vp and returns true. Otherwise it returns false.
355 JS_Init JSAPI Reference, SpiderMonkey
Initialize SpiderMonkey, returning true only if initialization succeeded. Once this method has succeeded, it is safe to call JS_NewRuntime and other JSAPI methods.
356 JS_InitCTypesClass JSAPI, JSAPI Reference, NeedsContent, Reference, Référence, SpiderMonkey
Initialize the ctypes object on a global object. The ctypes object will be frozen.
357 JS_InitClass JSAPI Reference, SpiderMonkey
JS_InitClass initializes a JSClass and (optionally) makes it visible to JavaScript code.
358 JS_InitStandardClasses JSAPI Reference, SpiderMonkey
JS_InitStandardClasses initializes the built-in JavaScript global properties. These include all the standard ECMAScript global properties defined in ECMA 262-3 §15.1:
359 JS_InstanceOf JSAPI Reference, Reference, Référence, SpiderMonkey
JS_InstanceOf can be used to check whether an object obj is of a particular JSClass. To use it this way, pass NULL for argv. JS_InstanceOf returns true if obj is of the given class and false otherwise. That is, it returns JS_GetClass(obj) == clasp.
360 JS_InternJSString JSAPI Reference, Reference, Référence, SpiderMonkey
JS_InternJSString converts a string str to interned string (interned atom) and returns the result string as JSString *.
361 JS_InternString JSAPI Reference, SpiderMonkey
No summary!
362 JS_IsArrayObject JSAPI Reference, SpiderMonkey
JS_IsArrayObject determines if a specified object, obj or value, is an Array object.
363 JS_IsAssigning JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
JS_IsAssigning returns true if a script is executing and its current bytecode is a set (assignment) operation, even if there are native (no script) stack frames between the script and the caller to JS_IsAssigning.
364 JS_IsBuiltinEvalFunction JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsBuiltinEvalFunction returns whether the given function is the global eval function.
365 JS_IsBuiltinFunctionConstructor JSAPI Reference, Reference, Référence, SpiderMonkey
JS::IsCallable returns whether the given function is the global Function constructor.
366 JS_IsConstructing JSAPI Reference, Obsolete, SpiderMonkey
JS_IsConstructing must be called only from a JSNative called from the engine. cx and vp must be the arguments that the engine passed to that JSNative.
367 JS_IsConstructing_PossiblyWithGivenThisObject JSAPI, JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
In the case of a constructor called from JS_ConstructObject and JS_InitClass where the class has the JSCLASS_CONSTRUCT_PROTOTYPE flag set, SpiderMonkey passes the constructor a non-standard this object. In such cases, the following example would provide the additional information of whether a special this was supplied.
368 JS_IsConstructor JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsConstructor determines if a specified function, fun is a valid constructor object. If so, JS_IsConstructor returns true. Otherwise it returns false.
369 JS_IsExceptionPending JSAPI Reference, SpiderMonkey
JS_IsExceptionPending returns true if an exception has been thrown in the context cx and the exception has not yet been caught or cleared. Otherwise, it returns false
370 JS_IsExtensible JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsExtensible queries [[Extensible]] property of the specified object, obj.
371 JS_IsExternalString JSAPI, JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsExternalString returns true if the string is an external string; otherwise it's false.
372 JS_IsGlobalObject JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsGlobalObject returns true if obj is a global object, false otherwise.
373 JS_IsIdentifier JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsIdentifier tests if the given string is a valid ECMAScript identifier. On successful, JS_IsIdentifier stores the test result to *isIdentifier and returns true, otherwise returns false and the value of *isIdentifier is undefined.
374 JS_IsNative JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsNative returns true if the object is a native object.
375 JS_IsNativeFunction JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsNativeFunction determines if a specified function object, funobj equals a specified native function, call. If so, JS_IsNativeFunction returns true. Otherwise it returns false.
376 JS_IsRunning JSAPI Reference, SpiderMonkey
JS_IsRunning determines if a script or function is currently executing in a specified JSContext, cx. If a script is executing, JS_IsRunning returns true. Otherwise it returns false.
377 JS_IsStopIteration JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsStopIteration returns true if v is StopIteration, otherwise false.
378 JS_IterateCompartments JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IterateCompartments 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.
379 JS_LeaveCompartment JSAPI Reference, SpiderMonkey
No summary!
380 JS_LeaveCrossCompartmentCall JSAPI Reference, Obsolete, SpiderMonkey
No summary!
381 JS_LeaveLocalRootScope JSAPI Reference, Obsolete, SpiderMonkey
See JS_EnterLocalRootScope for an explanation of local root scopes.
382 JS_LeaveLocalRootScopeWithResult JSAPI Reference, Obsolete, SpiderMonkey
See JS_EnterLocalRootScope for an explanation of local root scopes.
383 JS_LinkConstructorAndPrototype JSAPI Reference, Reference, Référence, SpiderMonkey
JS_LinkConstructorAndPrototype sets the prototype property of class constructor function, ctor, to prototype object, proto with JSPROP_PERMANENT | JSPROP_READONLY flags, and sets the constructor property of proto to ctor with no flag.
384 JS_Lock JSAPI Reference, SpiderMonkey
Lock the JS run-time environment.
385 JS_LockGCThing JSAPI Reference, Obsolete, SpiderMonkey
JS_LockGCThing is a deprecated function that protects a specified item, thing, associated with an executable script context, cx, from garbage collection. thing is a pointer to a jsdouble, JSString, or JSObject.
386 JS_LookupElement JSAPI Reference, Obsolete, SpiderMonkey
JS_LookupElement examines a specified JavaScript object, obj, for a numeric property numbered index.
387 JS_LookupProperty JSAPI Reference, Obsolete, SpiderMonkey
The functions JS_LookupProperty, JS_LookupUCProperty, JS_LookupPropertyById, JS_LookupPropertyWithFlags, and JS_LookupPropertyWithFlagsById search a specified object, obj, for a property with the given name. These functions all have similar behavior:
388 JS_LooselyEqual JSAPI Reference, SpiderMonkey
JS_LooselyEqual determines if v1 is loosely equal to v2 under the JavaScript == operator, as specified in ECMA 262-3 §11.9.3. If the comparison attempt was successful, the method returns JS_TRUE and stores the result in *equal; otherwise it returns JS_FALSE.
389 JS_MakeStringImmutable JSAPI Reference, Obsolete, SpiderMonkey
A string's characters can never be changed, but SpiderMonkey uses two string optimization techniques behind the scenes:
390 JS_MapGCRoots JSAPI Reference, Obsolete, SpiderMonkey
Call JS_MapGCRoots to map the GC's roots table using map(rp, name, data). The root is pointed at by rp; if the root is unnamed, name is null; data is supplied from the third parameter to JS_MapGCRoots.
391 JS_MaybeGC JSAPI Reference, SpiderMonkey
JS_MaybeGC tries to determine whether garbage collection in cx's runtime would free up enough memory to be worth the amount of time it would take. If so, it performs some garbage collection.
392 JS_New JSAPI Reference, SpiderMonkey
JS_New creates a new object as though by using the new operator, as described in ECMA 262-3 §11.2.2.
393 JS_NewArrayObject JSAPI Reference, Reference, Référence, SpiderMonkey
JS_NewArrayObject with contents parameter creates a new array object with the specified contents elements. JS_NewArrayObject defines an enumerable array element with the value contents[i] on the new array.
394 JS_NewCompartmentAndGlobalObject JSAPI Reference, Obsolete, SpiderMonkey
No summary!
395 JS_NewContext JSAPI Reference, SpiderMonkey
JS_NewContext creates a new JSContext in the runtime rt. On success, it returns a pointer to the new context. Otherwise it returns NULL. For more details about contexts, see JSContext. For sample code that creates and initializes a JSContext, see JSAPI User Guide.
396 JS_NewDateObject Date, JSAPI, JSAPI Reference, SpiderMonkey
Creates and returns a new JSObject representing a JavaScript Date object, which is pre-configured using the specified values.
397 JS_NewDateObjectMsec Date, JSAPI, JSAPI Reference, SpiderMonkey
The returned JSObject is a standard JavaScript Date.
398 JS_NewDependentString JSAPI Reference, SpiderMonkey
JS_NewDependentString creates a new string as a substring of an existing JavaScript string, str. The new string contains the same characters as if it were created with the JavaScript method str.substr(start, length).
399 JS_NewDouble JSAPI Reference, Obsolete, SpiderMonkey
JS_NewDouble allocates a copy of the number d on the JavaScript garbage collection heap. This function is not very useful. To convert a jsdouble to a jsval, use JS_NewNumberValue instead.
400 JS_NewDoubleValue JSAPI Reference, Obsolete, SpiderMonkey
JS_NewDoubleValue creates a floating-point jsval.
401 JS_NewExternalString JSAPI Reference, Reference, Référence, SpiderMonkey
JS_NewExternalString and JS_NewExternalStringWithClosure create a new JSString whose characters are stored in external memory, i.e., memory allocated by the application, not the JavaScript engine. Since the program allocated the memory, it will need to free it; this happens in an external string finalizer indicated by the type parameter.
402 JS_NewFunction JSAPI Reference, Reference, Référence, SpiderMonkey
JS_NewFunction creates a new JavaScript function implemented in C/C++. (To create a new function implemented in JavaScript, use JS_CompileFunction instead.)
403 JS_NewGlobalObject JSAPI, JSAPI Reference
JS_NewGlobalObject creates a new global object based on the specified class.
404 JS_NewNumberValue JSAPI Reference, Obsolete, SpiderMonkey
JS_NewNumberValue converts a C floating-point number of type jsdouble to jsval, the type of JavaScript values.
405 JS_NewObject JSAPI Reference, SpiderMonkey
JS_NewObject creates a new object based on a specified class. cx is a pointer to a context associated with the runtime in which to establish the new object. clasp is a pointer to an existing class to use for internal methods, such as finalize. The JavaScript engine selects a prototype object for you.
406 JS_NewObjectForConstructor JSAPI Reference, SpiderMonkey
JS_NewObjectForConstructor creates a new object exactly as the given constructor would if invoked with new. This function does not run the code of the constructor function--it just creates the object.
407 JS_NewPlainObject JSAPI Reference, Reference, Référence, SpiderMonkey
JS_NewPlainObject creates a new plain object, like new Object(), with Object.prototype as [[Prototype]].
408 JS_NewPropertyIterator JSAPI Reference, Obsolete, SpiderMonkey
Create an object to iterate over the enumerable own properties of obj, in arbitrary order. (This differs from longstanding for..in loop order, which uses the order in which obj's properties were defined. Note also that while for..in includes properties inherited from prototypes, iterator objects do not.)
409 JS_NewRegExpObject JSAPI Reference, Reference, Référence, SpiderMonkey
JS_NewRegExpObject and JS_NewUCRegExpObject create a new RegExp instance. The flags from the built-in RegExp constructor properties ignoreCase, global, multiline, and sticky are OR'd in with the provided flags parameter.
410 JS_NewRuntime JSAPI Reference, SpiderMonkey
JS_NewRuntime initializes the JavaScript runtime environment. Call JS_NewRuntime before making any other API calls except JS_Init. JS_NewRuntime allocates memory for the JSRuntime and initializes certain internal runtime structures. maxbytes specifies the number of allocated bytes after which garbage collection is run. If parentRuntime is specified, the resulting runtime shares significant amounts of read-only state (the self-hosting and initial atoms compartments). It is recommended to make use of this for every runtime in a process after the first one.
411 JS_NewScriptObject JSAPI Reference, Obsolete, SpiderMonkey
JS_NewScriptObject returns the script object associated with the given JSScript.
412 JS_NewStringCopyN JSAPI Reference, SpiderMonkey
JS_NewStringCopyN allocates space for a JavaScript string and its underlying storage, and copies n characters from a C character array, s, into the new JSString. JS_NewUCStringCopyN is the Unicode version of the function. The two functions differ only in the type of the character array s; both functions create ordinary JavaScript strings, and all JavaScript strings are made up of 16-bit characters.
413 JS_NewStringCopyZ JSAPI Reference, SpiderMonkey
JS_NewStringCopyZ allocates space for a new JavaScript string and its underlying storage, and then copies the contents of a null-terminated character array, s, into the new string. On success, JS_NewStringCopyZ returns a pointer to the new JavaScript string. On error, it returns NULL.
414 JS_NewUCString JSAPI Reference, SpiderMonkey
JS_NewString creates and returns a new string, using the memory starting at buf and ending at buf + length as the character storage. JS_NewUCString is the Unicode version of the function.
415 JS_NextProperty JSAPI Reference, Obsolete, SpiderMonkey
On success, JS_NextProperty returns true, with *idp containing the id of the next enumerable own property to visit using iterobj, or JSID_VOID if there is no such property left to visit. On error, it returns false, and the value left in *idp is undefined.
416 JS_Now JSAPI Reference, Reference, Référence, SpiderMonkey
JS_Now returns microseconds since the epoch, midnight, January 1, 1970 UTC.
417 JS_NumberValue JSAPI Reference, Reference, Référence, SpiderMonkey
JS_NumberValue converts a C floating-point number of type double to JS::Value, the type of JavaScript values.
418 JS_ObjectIsDate Date, JSAPI Reference, JavaScript, SpiderMonkey
JS_ObjectIsDate() can be used to check if you are dealing with a Date object, or a Date object used across compartments (or windows or sites, in the browser embedding).  This function returns true if the object is a Date.
419 JS_ObjectIsFunction JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ObjectIsFunction tests 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).
420 JS_ObjectIsRegExp JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ObjectIsRegExp determines if a specified object, obj, is a RegExp object. If so, JS_ObjectIsRegExp returns true. Otherwise it returns false.
421 JS_PSGS JSAPI Reference, Reference, Référence, SpiderMonkey
These macros encapsulate the definition of JSNative-backed JSPropertySpecs, by defining the JSNativeWrappers for them.
422 JS_ParseJSON
Parse a string using the JSON syntax described in ECMAScript 5 and return the corresponding value.
423 JS_PopArguments JSAPI_Reference, Obsolete, SpiderMonkey
JS_PopArguments frees the stack frame pointer previously allocated by JS_PushArguments and unroots the jsvals which have been associated with it (those returned by JS_PushArguments as well).
424 JS_PreventExtensions JSAPI Reference, SpiderMonkey
All JavaScript objects recognize the concept of extensibility: whether new properties may be added to the object.  In some situations, it may be convenient to prohibit new properties.  In JavaScript this may be accomplished using the Object.preventExtensions method.  The similar JSAPI method is JS_PreventExtensions.
425 JS_PropertyStub JSAPI Reference, SpiderMonkey
The stub functions are not designed to be called directly by a JSAPI application. Rather, they are convenient stand-ins anywhere the JSAPI requires callbacks of certain types. Examples at JSClass illustrate how stub functions can be used.
426 JS_PushArguments JSAPI Reference, Obsolete, SpiderMonkey
JS_PushArguments provides a convenient way to translate a series of native C/C++ values to jsvals with a single function call.
427 JS_PutEscapedString JSAPI Reference, Reference, Référence, SpiderMonkey
JS_PutEscapedString and JS_PutEscapedString write str into buffer escaping any non-printable or non-ASCII character using \escapes for JS string literals. Guarantees that a NUL is at the end of the buffer unless size is 0. Returns the length of the written output, NOT including the NUL. Thus, a return value of size or more means that the output was truncated. If buffer is null, just returns the length of the output. If quote is not 0, it must be a single or double quote character that will quote the output.
428 JS_Remove*Root JSAPI Reference, Obsolete, SpiderMonkey
JS_RemoveRoot removes the variable that rp points to from the garbage collector's root set.
429 JS_RemoveExternalStringFinalizer JSAPI Reference, Obsolete, SpiderMonkey
Remove finalizer from the global GC finalizers table, returning its type code if found, -1 if not found.
430 JS_RemoveRootRT JSAPI Reference, Obsolete, SpiderMonkey
Unregisters a pointer to a GC thing so that it is no longer a member of the garbage collector's root set. This enables any pointed-at GC thing to be garbage collected as needed.
431 JS_ReportError JSAPI Reference, SpiderMonkey
JS_ReportError is the simplest JSAPI function for reporting errors. First it builds an error message from the given sprintf-style format string and any additional arguments passed after it. The resulting error message is passed to the context's JSErrorReporter callback, if any.
432 JS_ReportErrorNumber JSAPI Reference, NeedsContent, SpiderMonkey
These functions create a JSErrorReport, populate it with an error message obtained from the given JSErrorCallback, and either report it to the current error reporter callback or create an Error object and set it as the pending exception.
433 JS_ReportOutOfMemory JSAPI Reference, SpiderMonkey
Call JS_ReportOutOfMemory to report that an operation failed because the system is out of memory. When the JavaScript engine tries to allocate memory and allocation fails, it reports an error as though by calling this function.
434 JS_ReportPendingException JSAPI Reference, SpiderMonkey
If an exception is pending in the context cx, JS_ReportPendingException converts the exception to a string and reports it to the current error reporter.
435 JS_ResolveStandardClass JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ResolveStandardClass resolves 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.
436 JS_RestoreExceptionState JSAPI Reference, SpiderMonkey
This function permits to restore any previously saved exception state which was saved into a JSExceptionState object created by the JS_SaveExceptionState function.
437 JS_SET_TRACING_DETAILS JSAPI Reference, SpiderMonkey
Set debugging information about the next thing to be traced by a JSTracer.
438 JS_SameValue JSAPI Reference, Reference, Référence, SpiderMonkey
SameValue slightly differs from strict equality (===) in that +0 and -0 are not the same and in that NaN is the same as NaN. The SameValue algorithm is equivalent to the following JavaScript:
439 JS_SaveExceptionState JSAPI Reference, SpiderMonkey
Saves the current exception state (that is, any pending exception, or a cleared exception state) associated with the specified context cx, and returns a JSExceptionState object holding this state. That object may then be used to restore again the context using JS_RestoreExceptionState, or discarded using JS_DropExceptionState. Either of those two functions frees any memory used by the JSExceptionState.
440 JS_SaveFrameChain JSAPI Reference, SpiderMonkey
These two functions are used to set aside cx's call stack while that stack is inactive. After a call to JS_SaveFrameChain, it looks as if there is no code running on cx. Before calling JS_RestoreFrameChain, cx's call stack must be balanced and all nested calls to JS_SaveFrameChain must have had matching JS_RestoreFrameChain calls.
441 JS_ScheduleGC JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ScheduleGC sets the nextScheduled parameter of GC.
442 JS_SealObject JSAPI Reference, Obsolete, SpiderMonkey
JS_SealObject prevents all write access to the object, either to add a new property, delete an existing property, or set the value or attributes of an existing property.
443 JS_SetAllNonReservedSlotsToUndefined JSAPI Reference, SpiderMonkey
JS_SetAllNonReservedSlotsToUndefined assignes undefined to all of obj's own properties, except the special __proto__ and __parent__ properties, in a single operation. Properties belonging to objects on obj's prototype chain are not affected.
444 JS_SetArrayLength JSAPI Reference, SpiderMonkey
JS_SetArrayLength sets the .length property of an object obj. length indicates the number of elements. JS_SetArrayLength(cx, obj, n) is exactly the same as setting the length property of obj to n using JS_SetProperty. This is true even if obj is not an Array object.
445 JS_SetBranchCallback JSAPI Reference, Obsolete, SpiderMonkey
If the callback returns JS_TRUE, the JS engine continues to execute the script.
446 JS_SetCallReturnValue2 JSAPI Reference, Obsolete, SpiderMonkey
Calling JS_SetCallReturnValue2 indicates to the runtime that the native will return a value of type Reference.
447 JS_SetCheckObjectAccessCallback JSAPI Reference, SpiderMonkey
Set the runtime-wide check-object-access callback. This function is deprecated. In SpiderMonkey 1.8.1 and later, use JS_SetRuntimeSecurityCallbacks instead.
448 JS_SetCompartmentNameCallback JSAPI Reference, Reference, Référence, SpiderMonkey
JS_SetCompartmentNameCallback sets callback function which will be called to name the compartment. If the runtime has no JSCompartmentNameCallback, a compartment will be named "<unknown>"</unknown>.
449 JS_SetContextCallback JSAPI Reference, SpiderMonkey
JS_SetContextCallback specifies a callback function that is automatically called when JSContexts are created or destroyed. Only one callback function may be specified per JS runtime. This function returns the previous context callback, if any, else NULL.
450 JS_SetDefaultLocale JSAPI Reference, Reference, Référence, SpiderMonkey
JS_SetDefaultLocale sets the default locale for the ECMAScript Internationalization API (Intl.Collator, Intl.NumberFormat, Intl.DateTimeFormat).
451 JS_SetDestroyCompartmentCallback JSAPI Reference, Reference, Référence, SpiderMonkey
JS_SetDestroyCompartmentCallback sets callback function which will be called when sweeping each compartment of the runtime, before deleting the compartment.
452 JS_SetElement JSAPI Reference, SpiderMonkey
JS_SetElement assigns a value to a numeric property of an object. It behaves like the JavaScript expression obj[index] = v.
453 JS_SetErrorReporter JSAPI Reference, SpiderMonkey
JS_SetErrorReporter enables you to define and use your own error reporting mechanism in your applications. The reporter you define is automatically passed a JSErrorReport structure when an error occurs and has been parsed by JS_ReportError. JS_SetErrorReporter
454 JS_SetExtraGCRoots JSAPI Reference, SpiderMonkey
Register externally maintained GC roots.
455 JS_SetFunctionCallback JSAPI Reference, Obsolete, SpiderMonkey
JS_SetFunctionCallback sets a C function to be called each time a JavaScript function is invoked or exits.
456 JS_SetGCCallback JSAPI Reference, SpiderMonkey
JS_SetGCCallback sets a callback function which the garbage collector calls at several points during garbage collection. rt is the runtime in which you specify the callback. cb is a pointer to the new callback function to use.
457 JS_SetGCParametersBasedOnAvailableMemory JSAPI Reference, Reference, Référence, SpiderMonkey
JS_SetGCParametersBasedOnAvailableMemory adjusts the parameters of the garbage collection based on available memory.
458 JS_SetGCZeal JSAPI Reference, SpiderMonkey
JS_SetGCZeal sets the level of additional garbage collection to perform for a runtime, for the purpose of finding or reproducing bugs.
459 JS_SetGlobalObject JSAPI Reference, Obsolete, SpiderMonkey
This function is obsolete; see also JS_GetGlobalObject.
460 JS_SetICUMemoryFunctions
Sets the memory allocation and deallocation functions used by the ICU internationalization library.
461 JS_SetInterruptCallback JSAPI_Reference, Reference, Référence, SpiderMonkey
These functions allow setting an interrupt callback that will be called from the JS thread some time after any thread triggered the callback using JS_RequestInterruptCallback.
To schedule the GC and for other activities the engine internally triggers interrupt callbacks. The embedding should thus not rely on callbacks being triggered through the external API only.
462 JS_SetNativeStackQuota JSAPI Reference, Reference, Référence, SpiderMonkey
No summary!
463 JS_SetObjectPrincipalsFinder JSAPI Reference, SpiderMonkey
Set the runtime-wide object-principals-finder callback. This function is deprecated. In SpiderMonkey 1.8.1 or later, use JS_SetRuntimeSecurityCallbacks instead.
464 JS_SetOperationCallback JSAPI Reference, Obsolete, SpiderMonkey
These functions allow setting an operation callback that will be called from the JS thread some time after any thread triggered the callback using JS_TriggerOperationCallback.
To schedule the GC and for other activities the engine internally triggers operation callbacks. The embedding should thus not rely on callbacks being triggered through the external API only.
465 JS_SetOptions JSAPI Reference, Obsolete, SpiderMonkey
JS_SetOptions sets the option flags of a given JS context cx. This function returns a uint32 value containing the previous values of the flags.
466 JS_SetParent JSAPI Reference, Obsolete, SpiderMonkey
JS_SetParent sets an object's parent.
467 JS_SetPendingException JSAPI Reference, SpiderMonkey
JS_SetPendingException sets the current exception being thrown within a context. If an exception is already being thrown, it is replaced with the new one given.
468 JS_SetPrincipalsTranscoder JSAPI Reference, SpiderMonkey
Set the runtime-wide principals transcoder callback. This function is deprecated. In SpiderMonkey 1.8.1 or later, use JS_SetRuntimeSecurityCallbacks instead.
469 JS_SetPrivate JSAPI Reference, SpiderMonkey
If a JSClass has the JSCLASS_HAS_PRIVATE flag, each object of that class has a private field of type void * which the application may use for any purpose. It is especially useful for storing C/C++ data that should not be directly visible to scripts. For example, a Socket class might use the private data field to store the socket handle.
470 JS_SetProperty JSAPI Reference, Reference, Référence, SpiderMonkey
JS_SetProperty assigns the value v to the property name of the object obj. It behaves like the JavaScript expression obj[name] = v. JS_SetUCProperty is the Unicode version of the function. JS_SetPropertyById is the same but takes a JS::HandleId for the property name.
471 JS_SetPropertyAttributes JSAPI Reference, Obsolete, SpiderMonkey
JS_SetPropertyAttributes sets the attributes for a specified property, name of an object obj. JS_SetUCPropertyAttributes is the Unicode version of the function.
472 JS_SetPrototype JSAPI Reference, SpiderMonkey
JS_SetPrototype sets the prototype object for a specified object. A prototype object provides properties that are shared by similar JS object instances. Ordinarily you set a prototype for an object when you create the object with JS_NewObject, but if you do not set a prototype at that time, you can later call JS_SetPrototype to do so.
473 JS_SetRegExpInput JSAPI Reference, Reference, Référence, SpiderMonkey
JS_SetRegExpInput sets the pending input string of the built-in RegExp object to the specified input string. The JSREG_MULTILINE is set to multiline parameter, and other flags are all reset.
474 JS_SetScriptStackQuota JSAPI Reference, Obsolete, SpiderMonkey
Set the quota on the number of bytes that stack-like data structures can use when the runtime compiles and executes scripts. These structures also consume heap space, so JS_SetThreadStackLimit does not bound their size. The default quota is 32MB which is quite generous.
475 JS_SetThreadStackLimit JSAPI Reference, Obsolete, SpiderMonkey
No summary!
476 JS_SetVersion JSAPI Reference, Obsolete, SpiderMonkey
JS_SetVersion attempts to set the version of JavaScript to version for a specified executable script context, cx. The version comes from the JSVersion enumerated type.
477 JS_SetVersionForCompartment JSAPI Reference, Reference, Référence, SpiderMonkey
JS_SetVersionForCompartment attempts to set the version of JavaScript to version for a specified compartment, compartment. The version comes from the JSVersion enumerated type.
478 JS_ShutDown JSAPI Reference, SpiderMonkey
Destroys all free-standing resources allocated by SpiderMonkey, not associated with any JSRuntime, JSContext, or other structure.
479 JS_StrictlyEqual JSAPI Reference, SpiderMonkey
JS_StrictlyEqual determines if v1 is strictly equal to v2 under the JavaScript === operator, as specified in ECMA 262-3 §11.9.6. If the comparison attempt was successful, the method returns true and stores the result in *equal; otherwise it returns false.
480 JS_StringEqualsAscii JSAPI Reference, Reference, Référence, SpiderMonkey
JS_StringEqualsAscii and JS_FlatStringEqualsAscii compare string str and ASCII string asciiBytes.
481 JS_StringHasBeenInterned JSAPI Reference, Reference, Référence, SpiderMonkey
JS_StringHasBeenInterned returns true if the string str is interned.
482 JS_StringHasLatin1Chars JSAPI, JSAPI Reference, Reference, Référence, SpiderMonkey
JS_StringHasLatin1Chars returns true iff the string's characters are stored as Latin1.
483 JS_StringIsFlat JSAPI, JSAPI Reference, Reference, Référence, SpiderMonkey
JS_StringIsFlat returns true if the string is flattened.
484 JS_StringToVersion JSAPI Reference, SpiderMonkey
JS_StringToVersion attempts to convert the version string to a JSVersion value. JS_StringToVersion may return any of the following values:
485 JS_SuspendRequest JSAPI Reference, SpiderMonkey
Suspends the calling thread's current request, if any, to allow the thread to block or perform time-consuming calculations.
486 JS_THREADSAFE JSAPI Reference, SpiderMonkey
JS_THREADSAFE was a compile-time option that enables support for running multiple threads of JavaScript code concurrently as long as no objects or strings are shared between them.
487 JS_ThrowStopIteration JSAPI Reference, SpiderMonkey
JS_ThrowStopIteration throws the appropriate StopIteration object for the function currently executing in cx.
488 JS_ToggleOptions JSAPI Reference, Obsolete, SpiderMonkey
JS_ToggleOptions toggles context-wide options. It is equivalent to JS_SetOptions(cx, JS_GetOptions(cx) ^ options).
489 JS_TracerInit JSAPI Reference, Obsolete, SpiderMonkey
JS_TraceChildren and other tracing APIs call the tracer callback for each traceable thing directly referenced by a particular object or runtime structure. It is the callback's responsibility to ensure the traversal of the full object graph, if desired, by eventually calling JS_TraceChildren on the passed thing. In this case the callback must be prepared to deal with cycles in the traversal graph.
490 JS_TypeOfValue JSAPI Reference, SpiderMonkey
JS_TypeOfValue examines a specified JS value, v, and returns its JS data type. The return value is always one of JSTYPE_VOID, JSTYPE_OBJECT, JSTYPE_FUNCTION, JSTYPE_STRING, JSTYPE_NUMBER, or JSTYPE_BOOLEAN.
491 JS_Unlock JSAPI Reference, SpiderMonkey
Unlock a previously locked JS run-time environment.
492 JS_ValueToBoolean JSAPI Reference, Obsolete, SpiderMonkey
JS_ValueToBoolean converts a specified JavaScript value, v, to a boolean value. It implements the ToBoolean operator specified in ECMA 262-3 §9.2. On success, JS_ValueToBoolean stores the converted value in *bp and returns JS_TRUE. On error or exception, it returns JS_FALSE, and the value left in *bp is undefined.
493 JS_ValueToECMAInt32 JSAPI Reference, Obsolete, SpiderMonkey
JS_ValueToECMAInt32, JS_ValueToECMAUint32, and JS_ValueToUint16 convert a JavaScript value to various integer types as specified in the ECMAScript specification.
494 JS_ValueToFunction JSAPI Reference, SpiderMonkey
Convert a JS::Value to a JSFunction.
495 JS_ValueToId JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ValueToId converts a specified JS::Value, v, to a jsid. If v is an integer, *idp receives an integer jsid. Otherwise, if E4X support is enabled and v is an object, *idp receives an object jsid. Otherwise, *idp receives an interned string jsid based on the value of v. If v is not a string, it is converted to a string as if by calling JS_ValueToString.
496 JS_ValueToInt32 JSAPI Reference, Obsolete, SpiderMonkey
JS_ValueToInt32 converts a specified JS value, v, to a 32-bit signed integer (-2147483648 to 2147483647). First it converts v to a floating-point number as if by calling JS::ToNumber. If the result is NaN, an infinity, or a number outside the 32-bit range, JS_ValueToInt32 reports an error and conversion fails. Otherwise, the floating-point number is rounded to the nearest integer value.
497 JS_ValueToNumber JSAPI Reference, Obsolete, SpiderMonkey
JS_ValueToNumber converts a JavaScript value to a number. It implements the ToNumber operator described in ECMA 262-3 §9.3.
498 JS_ValueToObject JSAPI Reference, SpiderMonkey
JS_ValueToObject converts a specified JavaScript value, v, to an object. On success, this function stores either NULL or a pointer to the resulting object in *objp and returns true. Otherwise it returns false and the value left in *objp is unspecified.
499 JS_ValueToSource JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ValueToSource converts a specified JavaScript value, v, to a JavaScript source.
500 JS_ValueToString JSAPI Reference, Obsolete, SpiderMonkey
JS_ValueToString converts a specified JavaScript value, v, to a string. It implements the ToString operator specified in ECMA 262-3 §9.8. The result is like the JavaScript expression ""+v.
501 JS_VersionToString JSAPI Reference, SpiderMonkey
JS_VersionToString attempts to convert the version to a const char * string representation. JS_VersionToString may return any of the following values:
502 JS_YieldRequest JSAPI Reference, SpiderMonkey
Momentarily suspend the current JSAPI request, allowing garbage collection to run if another thread has requested it.
503 JS_freeop JSAPI Reference, Reference, Référence, SpiderMonkey
JS_freeop is a wrapper for js_free(p) that may delay js_free(p) invocation as a performance optimization as specified by the given JSFreeOp instance.
504 JS_malloc JSAPI Reference, SpiderMonkey
JS_malloc allocates a region of memory nbytes in size. On success, JS_malloc returns a pointer to the beginning of the region. As with the standard C function malloc, memory allocated by JS_malloc is uninitialized.
505 JS_updateMallocCounter JSAPI Reference, Reference, Référence, SpiderMonkey
JS_updateMallocCounter decrements malloc counter of GC and the zone of the context.
506 OBJECT_TO_JSVAL JSAPI Reference, Obsolete, SpiderMonkey
OBJECT_TO_JSVAL casts obj from type JSObject * to jsval. If obj is NULL, the result is JSVAL_NULL.
507 PRIVATE_TO_JSVAL JSAPI Reference, Obsolete, SpiderMonkey
With PRIVATE_TO_JSVAL(), an application can store a private data pointer, p, as a jsval. This can be useful with reserved slots.
508 Property attributes Attribute, JSAPI Reference, Reference, Référence, SpiderMonkey
Some property attributes are defined in the ECMAScript standard, in ECMA 262-3 §8.6.1. SpiderMonkey additionally defines several non-standard property attributes.
509 STRING_TO_JSVAL JSAPI Reference, Obsolete, SpiderMonkey
STRING_TO_JSVAL casts a given JSString * to jsval. str must be a non-null pointer of type JSString *. The conversion always succeeds.
510 Stored value JSAPI Reference, JavaScript, SpiderMonkey
In the JSAPI, the stored value of an object property is its last known value. For a data property, this is exactly the same thing as the property's current value.
511 jschar JSAPI Reference, Obsolete, SpiderMonkey
jschar, a typedef for the standard C++ type char16_t, will be removed in JSAPI 38. Functions that use jschar will use char16_t directly. Embedder code should use char16_t, too. (See bug 1063962.)
512 jsdouble JSAPI Reference, Obsolete, SpiderMonkey
jsdouble is a C floating-point number type. It is defined to be a 64-bit, IEEE 754 compliant type. See ECMA 262-3 §8.5. Arithmetic on jsdouble values in C should behave exactly like the floating-point arithmetic in JavaScript, except that C and JavaScript may treat not-a-number values differently.
513 jsid JSAPI Reference, Reference, Référence, SpiderMonkey
jsid is either a 31-bit signed integer, interned string or object.
514 jsint JSAPI Reference, Obsolete, SpiderMonkey
jsint and jsuint are 32-bit integer types.
515 JSDBGAPI JavaScript, SpiderMonkey
These functions can be used to profile a SpiderMonkey application using the Mac profiler, Shark. See Profiling JavaScript with Shark.
516 Java SpiderMonkey - MDN Build documentation, Guide, SpiderMonkey
Use these instructions to build the latest SpiderMonkey source code.
517 Parser API API, Guide, JavaScript, SpiderMonkey
Example:
518 Profiling SpiderMonkey Guide
Editorial review completed.
519 Running Automated JavaScript Tests Automated testing, Build documentation, Guide, QA, SpiderMonkey
The jstests shell harness is js/src/tests/jstests.py. Basic usage is:
520 Running Parsemark SpiderMonkey, tests
Here's how you get your mitts on it. The test files are not checked into the source tree because they're non-Mozilla JS code.
521 SavedFrame SpiderMonkey
A SavedFrame instance is a singly linked list of stack frames. It represents a JavaScript call stack at a past moment of execution. Younger frames hold a reference to the frames that invoked them. The older tails are shared across many younger frames.
522 Setting up CDT to work on SpiderMonkey Developing Mozilla, Eclipse, IDE, SpiderMonkey, Tools
For CDT to index all code, SpiderMonkey has to be built with debug information. The full process of and requisites for doing so are described here. Please follow those instructions up until the point of invoking configure.
523 Shell global objects JavaScript, NeedsContent, SpiderMonkey
These are the global objects that are set up automatically by the SpiderMonkey js command-line interpreter when you start the program.
524 SpiderMonkey Build Documentation Build documentation, Guide, SpiderMonkey
Use these instructions to build the latest SpiderMonkey source code.
525 Rebranding SpiderMonkey (1.8.5) Build documentation, SpiderMonkey
After installing the build pre-requisites and downloading the SpiderMonkey source tarball issue the following commands at the terminal:
526 SpiderMonkey Internals Guide, JavaScript, NeedsUpdate, SpiderMonkey
At heart, SpiderMonkey is a fast interpreter that runs an untyped bytecode and operates on values of type JS::Value—type-tagged values that represent the full range of JavaScript values. In addition to the interpreter, SpiderMonkey contains a Just-In-Time (JIT) compiler, a garbage collector, code implementing the basic behavior of JavaScript values, a standard library implementing ECMA 262-5.1 §15 with various extensions, and a few public APIs.
527 64-bit Compatibility SpiderMonkey
The following types or typedefs are always 64-bit on 64-bit platforms, and 32-bit on 32-bit platforms:
528 Bytecode Descriptions SpiderMonkey
This document is automatically generated from Opcodes.h by make_opcode_doc.py.
529 Bytecodes SpiderMonkey
SpiderMonkey bytecodes are the canonical form of code representation that is used in the JavaScript engine. The JavaScript frontend constructs an AST from the source text, then emits stack-based bytecodes from that AST as a part of the JSScript data structure. Bytecodes can reference atoms and objects (typically by array index) which are also contained in the JSScript data structure.
530 Functions SpiderMonkey
There are several flavors of JavaScript function. All are JSObjects of the same class, js_FunctionClass.
531 Garbage collection Guide, NeedsContent, SpiderMonkey
SpiderMonkey has a mark-sweep garbage collection (GC) with an optionally enabled incremental marking mode. The mark phase uses a mark stack, as required by incremental marking. Sweeping of objects without finalizers is deferred to a background thread.
532 Invariants SpiderMonkey
or, "The Zen of SpiderMonkey".
533 Property cache SpiderMonkey
SpiderMonkey's property cache is an internal data structure used to speed up property accesses in the interpreter and to communicate between the interpreter and JIT.
534 Self-hosted builtins in SpiderMonkey JavaScript, SpiderMonkey
All self-hosted code is strict, so self-hosted functions invoked in a null or undefined scope won't be run in the scope of the global object.
535 SpiderMonkey Internals: Thread Safety Guide, SpiderMonkey
This page describes implementation details of the SpiderMonkey JavaScript engine. It is mainly of interest to people working on SpiderMonkey itself. See JS_THREADSAFE for a gentler introduction to using SpiderMonkey in a multi-threaded application.
536 Tracing JIT SpiderMonkey
The tracing JIT in SpiderMonkey consists of a generic, low level component called nanojit which is co-maintained between Adobe and Mozilla, and a SpiderMonkey-specific high level component called jstracer. The nanojit component is language agnostic, and contains no knowledge about SpiderMonkey or any other part of the Mozilla codebase. The jstracer component consists of a monitor and a recorder. The monitor watches the executing SpiderMonkey interpreter. When the monitor determines that the interpreter has entered a region of code that would benefit from native compilation, the monitor activates the recorder. The recorder records the activity of the interpreter, using nanojit to build an efficient, native representation of the execution called a fragment. The monitor then calls into the native code stored in the fragment.
537 SpiderMonkey compartments Guide, NeedsContent, NeedsExample, SpiderMonkey
No summary!
538 SpiderMonkey releases SpiderMonkey
No summary!
539 SpiderMonkey 1.8 SpiderMonkey
SpiderMonkey 1.8 has one known significant regression from 1.7.
540 SpiderMonkey 1.8.5 SpiderMonkey
SpiderMonkey 1.8.5 is supported on all the platforms where Firefox 4 runs.
541 SpiderMonkey 1.8.7 SpiderMonkey
DRAFT IN PROGRESS - This is a draft, and right now it's mostly just a copy of the 1.8.5 release notes.
542 SpiderMonkey 1.8.8 SpiderMonkey
SpiderMonkey 1.8.8 is supported on all the platforms where Firefox INSERT-ACTUAL-FIREFOX-VERSION-NUMBER-HERE runs.
543 SpiderMonkey 17 SpiderMonkey
SpiderMonkey 17 is supported on all the platforms where Firefox 17 runs.
544 SpiderMonkey 24 SpiderMonkey
SpiderMonkey 24 is supported on all the platforms where Firefox 24 runs.  Compiling it requires a C++ compiler, and the JSAPI can only be used from C++ code.  (This change was motivated by garbage collector improvements, which lean quite heavily on C++'s support for RAII through constructors and destructors.)  If you are compiling with Microsoft's Visual Studio, note that the minimum supported version is MSVC10/2010: MSVC8/9 support has been dropped.
545 SpiderMonkey 31 SpiderMonkey
SpiderMonkey 31 is supported on all the platforms where Firefox 31 runs.  Compiling it requires a C++ compiler, and the JSAPI can only be used from C++ code.  If you are compiling with Microsoft's Visual Studio, note that the minimum supported version is MSVC10/2010: MSVC8/9 support has been dropped.
546 SpiderMonkey 38 SpiderMonkey
SpiderMonkey 38 is supported on all the platforms where Firefox 38 runs.  Compiling it requires a C++ compiler, and the JSAPI can only be used from C++ code.  If you are compiling with Microsoft's Visual Studio, note that the minimum supported version is MSVC10/2010.
547 SpiderMonkey 45
SpiderMonkey 45 is supported on all platforms able to run Firefox 45.  Compiling it requires a C++ compiler, and the JSAPI can only be used from C++ code.  If you are compiling with Microsoft's Visual Studio, note the minimum supported version is MSVC 2013.
548 Split object JSAPI Reference, JavaScript, SpiderMonkey
In SpiderMonkey, a split object is made up of two JSObjects: an inner object and an outer object.

Document Tags and Contributors

 Contributors to this page: jswisher, fscholz
 Last updated by: jswisher,