Index

Found 550 pages:

# Page Tags and summary
1 SpiderMonkey: The Mozilla JavaScript runtime SpiderMonkey
Standalone source code releases can be found on the Releases page.
2 Creating JavaScript tests Automated testing, Build documentation, Guide, QA, SpiderMonkey
In which test suite does your new test belong?
3 Creating JavaScript jstest reftests ECMAScript, Guide, JavaScript, test
In the js/src/tests directory, there are a few important subdirectories.
4 FOSS Guide, SpiderMonkey
Feel free to add your own SpiderMonkey-based open source projects (and if necessary add categories)!
5 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.
6 GC Rooting Guide SpiderMonkey
No summary!
7 GCIntegration Developing Mozilla, Firefox, Garbage collection, Intermediate, Intro, JSAPI, NeedsUpdate, SpiderMonkey, Tools, memory
The SpiderMonkey garbage collector (GC) will be changing a lot in the future. This page is intended to explain the changes that are happening, with a focus on how they will affect Gecko code that uses JSAPI. At a high level, there are three issues to be aware of:
8 Getting SpiderMonkey source code Guide, SpiderMonkey
You can get the SpiderMonkey source code in gzipped form or directly from the Mercurial repository.
9 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.
10 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!
11 Index Index, MDN Meta, SpiderMonkey
Found 550 pages:
12 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.
13 JIT Optimization Outcomes Beginner, Firefox, Intro, NeedsContent, SpiderMonkey
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.
14 JIT Optimization Strategies Junk, 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.
15 JSAPI Cookbook SpiderMonkey
This article shows the JSAPI equivalent for a tiny handful of common JavaScript idioms.
16 JSAPI User Guide JSAPI, SpiderMonkey
This document explains how to embed SpiderMonkey, the Mozilla JavaScript engine, in your C++ program.
17 JSAPI reference NeedsContent, SpiderMonkey
JS::DeflateStringToUTF8Buffer
18 BOOLEAN_TO_JSVAL JSAPI Reference, Obsolete, SpiderMonkey
BOOLEAN_TO_JSVAL converts a bool argument, b, to a boolean jsval.
19 DOUBLE_TO_JSVAL JSAPI Reference, Obsolete, SpiderMonkey
DOUBLE_TO_JSVAL is the inverse of JS::ToNumber.
20 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.
21 INT_TO_JSVAL JSAPI Reference, Obsolete, SpiderMonkey
INT_TO_JSVAL converts a C integer, i, to a jsval.
22 JS::Add*Root JSAPI Reference, NeedsContent, Obsolete, Reference, Référence(2), SpiderMonkey
These functions are obsoleted, use JS::PersistentRooted instead.
23 JS::AutoIdArray JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::AutoIdArray takes the ownership of JSIdArray, and frees it in destructor by calling JS_DestroyIdArray.
24 JS::AutoSaveExceptionState JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::AutoSaveExceptionState saves and later restores the current exception state of a given JSContext.
25 JS::AutoValueArray JSAPI Reference, Reference, Référence(2), 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.
26 JS::AutoVectorRooter JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::AutoVectorRooter<T> holds a variable-size rooted array of type T.
27 JS::BooleanValue JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::BooleanValue converts a C boolean of type bool to JS::Value, the type of JavaScript values.
28 JS::Call JSAPI Reference, Reference, SpiderMonkey
JS::Call calls a specified function, fun, on an object, thisObj. In terms of function execution, the object is treated as this.
29 JS::CallArgs JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::CallArgs is helper class encapsulating access to the callee, this value, arguments, and argument count for a function call.
30 JS::CloneFunctionObject JSAPI Reference, Reference, Référence(2), 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.
31 JS::Compile JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::Compile compiles a script, srcBuf, chars, bytes, or file, for execution.
32 JS::CompileFunction JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::CompileFunction compiles a function from a text string chars, bytes, or srcBuf.
33 JS::CompileOffThread JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::CompileOffThread compiles a script, chars for execution.
34 JS::CompileOptions JSAPI Reference, Reference, Référence(2), SpiderMonkey
Some methods of JS::OwningCompileOptions and JS::CompileOptions return the instance itself to allow method chain.
35 JS::Construct JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::Construct calls a specified function as a constructor, fun.
36 JS::CreateError JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::CreateError creates an Error object with specified properties.
37 JS::CurrentGlobalOrNull JSAPI Reference, Reference, Référence(2), 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.
38 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.
39 JS::DoubleNaNValue JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::DoubleNaNValue returns a value of type JS::Value that represents an IEEE floating-point quiet Not-a-Number (NaN).
40 JS::DoubleValue JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::DoubleValue converts a C floating-point number of type double to JS::Value, the type of JavaScript values.
41 JS::Evaluate JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::Evaluate compiles and executes a script in the specified scope, obj or scopeChain.
42 JS::FalseValue JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::FalseValue creates a JS::Value that represents the JavaScript value false.
43 JS::Float32Value JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::Float32Value converts a C floating-point number of type float to JS::Value, the type of JavaScript values.
44 JS::GetDeflatedUTF8StringLength JSAPI Reference, Reference, Référence(2), 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.
45 JS::GetFirstArgumentAsTypeHint JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::GetFirstArgumentAsTypeHint converts first argument of @@toPrimitive method to JSType.
46 JS::GetSelfHostedFunction JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::GetSelfHostedFunction creates a new JavaScript function implemented in self-hosted JavaScript.
47 JS::Handle JSAPI Reference, Reference, Référence(2), SpiderMonkey
Here, ptr represents the private member of JS::Handle<T>, typed with T.
48 JS::HandleValueArray JSAPI Reference, Reference, Référence(2), 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.
49 JS::IdentifyStandardInstance JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::IdentifyStandardInstance determines if the given object is an instance for a standard class. If so, return the associated JSProtoKey. If not, return JSProto_Null.
50 JS::Int32Value JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::Int32Value converts a C signed 32-bit integer of type int32_t to JS::Value, the type of JavaScript values.
51 JS::IsCallable JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::IsCallable returns whether the given function object is callable.
52 JS::MutableHandle JSAPI Reference, Reference, Référence(2), SpiderMonkey
Here, ptr represents the private member of JS::MutableHandle<T>, typed with T *.
53 JS::NewFunctionFromSpec JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::NewFunctionFromSpec creates a new function based on the given JSFunctionSpec, *fs. id is the result of a successful call to PropertySpecNameToPermanentId(cx, fs->name, &id).
54 JS::NullHandleValue JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::NullHandleValue is a JS::HandleValue constant that represents the JavaScript value null.
55 JS::NullValue JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::NullValue creates a JS::Value that represents the JavaScript value null.
56 JS::NumberValue JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::NumberValue converts a C integer or floating-point value to JS::Value, the type of JavaScript values.
57 JS::ObjectOrNullValue JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::ObjectValue converts a given JSObject to JS::Value. If the pointer is null, it returns JavaScript null. The conversion always succeeds.
58 JS::ObjectValue JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::ObjectValue converts a given JSObject to JS::Value. The conversion always succeeds.
59 JS::OrdinaryToPrimitive JSAPI Reference, Reference, Référence(2), 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.
60 JS::PersistentRooted JSAPI Reference, Reference, Référence(2), SpiderMonkey
Here, ptr represents the private member of JS::PersistentRooted<T>, typed with T.
61 JS::PropertySpecNameEqualsId JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::PropertySpecNameEqualsId determines if the given JSPropertySpec::name or JSFunctionSpec::name value equals the given jsid, and returns true if so.
62 JS::PropertySpecNameIsSymbol JSAPI Reference, Reference, Référence(2), 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.
63 JS::PropertySpecNameToPermanentId JSAPI Reference, Reference, Référence(2), 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..
64 JS::ProtoKeyToId JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::ProtoKeyToId converts a specified JS prototype key key, to a JS ID. JS::ProtoKeyToId stores a jsid to *idp.
65 JS::Remove*Root JSAPI Reference, Obsolete, Reference, Référence(2), SpiderMonkey
JS::Remove*Root removes the variable that rp points to from the garbage collector's root set.
66 JS::Rooted JSAPI Reference, Reference, Référence(2), SpiderMonkey
Here, ptr represents the private member of JS::Rooted<T>, typed with T.
67 JS::SetLargeAllocationFailureCallback JSAPI Reference, Reference, Référence(2), 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.)
68 JS::SetOutOfMemoryCallback JSAPI Reference, Reference, Référence(2), 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.
69 JS::SourceBufferHolder JSAPI Reference, Reference, Référence(2), 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:
70 JS::StringValue JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::StringValue converts a given JSString to JS::Value. The conversion always succeeds.
71 JS::SymbolValue JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::SymbolValue converts a given JS::Symbol to JS::Value. The conversion always succeeds.
72 JS::ToBoolean JSAPI Reference, SpiderMonkey
JS::ToBoolean converts a JavaScript value to a boolean. It implements the ToBoolean operation described in ECMA 262 §7.1.2.This function can not fail and the return value is always the boolean conversion of the argument.
73 JS::ToInt32 JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::ToInt32 converts a JavaScript value to a signed 32bit integer. It implements the ToInt32 operator described in ECMA 262-3 §9.5.
74 JS::ToInt64 JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::ToInt64 converts a JavaScript value to a signed 64bit integer.
75 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.
76 JS::ToPrimitive JSAPI Reference, SpiderMonkey
JS::ToPrimitive converts a JavaScript object, obj, to a primitive value using ECMAScript 6 ToPrimitive.
77 JS::ToString JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::ToString returns a string representation of a JavaScript value.
78 JS::ToUint16 JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::ToInt16 converts a JavaScript value to an unsigned 16bit integer. It implements the ToInt16 operator described in ECMA 262-3 §9.7.
79 JS::ToUint32 JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::ToInt32 converts a JavaScript value to an unsigned 32bit integer. It implements the ToInt32 operator described in ECMA 262-3 §9.6.
80 JS::ToUint64 JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::ToInt64 converts a JavaScript value to an unsigned 64bit integer.
81 JS::TrueHandleValue JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::TrueHandleValue and JS::FalseHandleValue are JS::HandleValue constants that represent the JavaScript values true and false.
82 JS::TrueValue JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::TrueValue creates a JS::Value that represents the JavaScript value true.
83 JS::UndefinedHandleValue JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::UndefinedHandleValue is a JS::HandleValue constant that represents the JavaScript value undefined.
84 JS::UndefinedValue JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::UndefinedValue creates a JS::Value that represents the JavaScript value undefined.
85 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.
86 JSAutoByteString JSAPI Reference, Reference, Référence(2), SpiderMonkey
JSAutoByteString takes the ownership of string and frees it in destructor.
87 JSAutoCompartment JSAPI Reference, SpiderMonkey
No summary!
88 JSBool JSAPI Reference, Obsolete, SpiderMonkey
No summary!
89 JSCheckAccessOp JSAPI Reference, Obsolete, Reference, Référence(2), 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.
90 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.
91 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!
92 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:
93 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.
94 JSConvertOp JSAPI Reference, Reference, Référence(2), 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.
95 JSDeletePropertyOp JSAPI Reference, Reference, 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.
96 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.
97 JSErrorFormatString JSAPI Reference, Reference, Référence(2), SpiderMonkey
JSErrorFormatString is a struct to represent error message and type, returned by JS_ReportErrorNumber function.
98 JSErrorReport JSAPI Reference, SpiderMonkey
JSErrorReport describes a single error that occurs in the execution of script.
99 JSExceptionState JSAPI Reference, SpiderMonkey
A JSExceptionState object is returned by the JS_SaveExceptionState function, and is passed to functions JS_RestoreExceptionState and JS_DropExceptionState.
100 JSExnType JSAPI Reference, Reference, Référence(2), 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.
101 JSExtendedClass JSAPI Reference, Obsolete, SpiderMonkey
To implement a custom class that uses any of the JSExtendedClass callbacks:
102 JSExtendedClass.outerObject JSAPI Reference, Obsolete, SpiderMonkey
See split objects.
103 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.
104 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.
105 JSFUN_GLOBAL_PARENT JSAPI Reference, Obsolete, SpiderMonkey
No summary!
106 JSFastNative JSAPI Reference, Obsolete, SpiderMonkey
The callback should use the following macros to access the fields of vp:
107 JSFinalizeOp JSAPI Reference, Reference, Référence(2), 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.)
108 JSFreeOp JSAPI Reference, Reference, Référence(2), 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.
109 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 *.
110 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.
111 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.
112 JSHasInstanceOp JSAPI Reference, Reference, Référence(2), 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.
113 JSID_EMPTY JSAPI Reference, Reference, Référence(2), SpiderMonkey
JSID_EMPTY is an internal jsid value which is used in type inference code.
114 JSID_IS_EMPTY JSAPI Reference, Reference, Référence(2), SpiderMonkey
JSID_IS_EMPTY tests whether a specified JS ID, id, is JSID_EMPTY.
115 JSID_IS_GCTHING JSAPI Reference, Reference, Référence(2), SpiderMonkey
JSID_IS_GCTHING tests whether a specified JS ID, id, is a GC thing, and returns true if it's a GC thing.
116 JSID_IS_INT JSAPI Reference, Reference, Référence(2), SpiderMonkey
JSID_IS_INT tests whether a specified JS ID, id, is an integer, and returns true if it's an integer.
117 JSID_IS_STRING JSAPI Reference, Reference, Référence(2), SpiderMonkey
JSID_IS_STRING tests whether a specified JS ID, id, is a string, and returns true if it's a string.
118 JSID_IS_SYMBOL JSAPI Reference, Reference, Référence(2), SpiderMonkey
JSID_IS_SYMBOL tests whether a specified JS ID, id, is a JS Symbol, and returns true if it's a JS Symbol.
119 JSID_IS_VOID JSAPI Reference, Reference, Référence(2), SpiderMonkey
JSID_IS_VOID tests whether a specified JS ID, id, is JSID_VOID.
120 JSID_IS_ZERO JSAPI Reference, Reference, Référence(2), SpiderMonkey
JSID_IS_ZERO tests whether a specified JS ID, id, is zero (0 in its integer representation).
121 JSID_VOID JSAPI Reference, Reference, Référence(2), 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.
122 JSIdArray JSAPI Reference, SpiderMonkey
JSIdArray is used to hold IDs for enumerated properties associated with an object.
123 JSIteratorOp JSAPI Reference, Obsolete, Reference, Référence(2), 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.
124 JSMarkOp JSAPI Reference, Obsolete, Reference, Référence(2), 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.
125 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.
126 JSNewEnumerateOp JSAPI Reference, Reference, Référence(2), 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.
127 JSNewResolveOp JSAPI Reference, Obsolete, SpiderMonkey
Like JSResolveOp, but flags provide contextual information about the property access.
128 JSObject JSAPI Reference, SpiderMonkey
Objects are made up of the following parts:
129 JSObjectOp JSAPI Reference, Obsolete, SpiderMonkey
The callbacks of this type are:
130 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]].
131 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.
132 JSObjectOps.destroyObjectMap JSAPI Reference, Obsolete, SpiderMonkey
No summary!
133 JSObjectOps.dropProperty JSAPI Reference, Obsolete, SpiderMonkey
The following contract governs JSObjectOps callers and implementations:
134 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.
135 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.
136 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.
137 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.cpp) access slots reserved by including a call to the JSCLASS_HAS_RESERVED_SLOTS(n) macro in the JSClass.flags initializer.
138 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.
139 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.
140 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.cpp for an example.
141 JSObjectPrincipalsFinder JSAPI Reference, Obsolete, SpiderMonkey
The JavaScript engine calls this callback to obtain principals for a JSPrincipals.subsume check.
142 JSPRINCIPALS_HOLD JSAPI Reference, Obsolete, SpiderMonkey
JSPRINCIPALS_HOLD and JSPRINCIPALS_DROP are used to manage memory for JSPrincipals objects.
143 JSPrincipals JSAPI Reference, Reference, Référence(2), 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.
144 JSPrincipalsTranscoder Advanced, Constructor, NeedsExample, Reference, SpiderMonkey
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.
145 JSProperty JSAPI Reference, Obsolete, Reference, SpiderMonkey
JSProperty is the abstract base class of all object properties. It is used internally in JSObjectOps.lookupProperty, getAttributes, setAttributes, and dropProperty.
146 JSPropertyDescriptor JSAPI Reference, Reference, Référence(2), SpiderMonkey
A descriptor is an object that can have the following key values
147 JSPropertyOp JSAPI Reference, SpiderMonkey
They are also the types of the JSClass.addProperty, getProperty, and setProperty callbacks, which are called during object property accesses.
148 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.
149 JSProtoKey JSAPI Reference, Reference, Référence(2), SpiderMonkey
Each of these types corresponds to standard objects in JavaScript. Some of them are Nightly only (depends on each option).
150 JSReserveSlotsOp JSAPI Reference, Obsolete, Reference, Référence(2), SpiderMonkey
JSClass offers the following hook:
151 JSResolveOp JSAPI Reference, Reference, Référence(2), SpiderMonkey
JSResolveOp callback is a hook which is called when a property is not found on an object.
152 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.
153 JSSecurityCallbacks.contentSecurityPolicyAllows
The JSSecurityCallbacks.contentSecurityPolicyAllows callback is called when a script attempts to access an object property. The callback can deny the script access to the property.
154 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.
155 JSStringFinalizer JSAPI Reference, Reference, Référence(2), SpiderMonkey
JSStringFinalizer::finalize finalizes external strings created by JS_NewExternalString.
156 JSTraceOp JSAPI Reference, Reference, Référence(2), 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.
157 JSType JSAPI Reference, SpiderMonkey
No summary!
158 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).
159 JSVAL_IS_DOUBLE JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_DOUBLE(v) is true if v is a number represented in memory as a jsdouble.
160 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.
161 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.
162 JSVAL_IS_NULL JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_NULL(v) is true if v is JSVAL_NULL, which is the JavaScript null value.
163 JSVAL_IS_NUMBER JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_NUMBER(v) is true if v is a JavaScript number.
164 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.
165 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.
166 JSVAL_IS_STRING JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_STRING(v) is true if v is a string.
167 JSVAL_IS_VOID JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_VOID(v) is true if v is JSVAL_VOID, which represents the JavaScript value undefined.
168 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.
169 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).
170 JSVAL_ONE JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_ONE is equivalent to INT_TO_JSVAL(1).
171 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.
172 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.
173 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 *.
174 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.
175 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.
176 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.
177 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.
178 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.
179 JSVAL_VOID JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_VOID is a jsval constant that represents the JavaScript value undefined.
180 JSVAL_ZERO JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_ZERO is equivalent to INT_TO_JSVAL(0).
181 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.
182 JSXDRObjectOp JSAPI Reference, Obsolete, Reference, Référence(2), SpiderMonkey
Serialize or deserialize an object, given an XDR state record representing external data. See jsxdrapi.h.
183 JS_ASSERT_STRING_IS_FLAT JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_ASSERT_STRING_IS_FLAT asserts the string is flattened, and returns a pointer to JSFlatString.
184 JS_Add*Root JSAPI Reference, Obsolete, SpiderMonkey
These functions are obsoleted, use JS::PersistentRooted instead.
185 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.)
186 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).
187 JS_AddFinalizeCallback JSAPI Reference, Reference, Référence(2), 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.
188 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.
189 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.
190 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.
191 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.
192 JS_BindCallable JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_BindCallable binds the given callable to use the given object as this.
193 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.
194 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.
195 JS_CallFunction JSAPI Reference, SpiderMonkey
Calls a specified JS function.
196 JS_CheckAccess JSAPI Reference, SpiderMonkey
Check whether a running script may access a given object property.
197 JS_CheckForInterrupt JSAPI_Reference, Reference, Référence(2), SpiderMonkey
JS_CheckForInterrupt checks for the interrupt, and handle it if it's pending. JS_CheckForInterrupt returns false if interrupt callback returns false.
198 JS_ClearContextThread JSAPI Reference, SpiderMonkey
Transfer a JSContext from one thread to another.
199 JS_ClearDateCaches Date, JSAPI Reference, JavaScript, Reference, Référence(2), SpiderMonkey
JS_ClearDateCaches clears the cache of calculated local time from each Date object. Call to propagate a system timezone change.
200 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.
201 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.
202 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.)
203 JS_ClearRegExpStatics JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_ClearRegExpStatics clears the pending input string and flags of the built-in RegExp object.
204 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.
205 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.
206 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.
207 JS_CompileFileHandleForPrincipals JSAPI Reference, NeedsContent, Obsolete, SpiderMonkey
Please provide a description of this function.
208 JS_CompileFileHandleForPrincipalsVersion JSAPI Reference, NeedsContent, Obsolete, SpiderMonkey
Please provide a description for this function.
209 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.
210 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.
211 JS_CompileScript JSAPI Reference, SpiderMonkey
JS_CompileScript compiles a script, source, for execution. JS_CompileUCScript is the Unicode version of the function.
212 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.
213 JS_CompileUCFunctionForPrincipalsVersion JSAPI Reference, NeedsContent, Obsolete, SpiderMonkey
Please provide a description for this function.
214 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.
215 JS_CompileUTF8FileHandle JSAPI Reference, Obsolete, SpiderMonkey
No summary!
216 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.
217 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.
218 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.
219 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.
220 JS_ConvertArgumentsVA JSAPI Reference, Obsolete, SpiderMonkey
JS_ConvertArgumentsVA is to JS_ConvertArguments as vprintf is to printf. See JS_ConvertArguments for further information.
221 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.
222 JS_DecompileFunction JSAPI Reference, SpiderMonkey
JS_DecompileFunction generates the complete source code of a function declaration from a function's compiled form, fun.
223 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.
224 JS_DecompileScript JSAPI Reference, Reference, Référence(2), 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.
225 JS_DecompileScriptObject JSAPI Reference, NeedsContent, SpiderMonkey
FIXME: Please provide a description for this function.
226 JS_DeepFreezeObject JSAPI Reference, Reference, Référence(2), 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.
227 JS_DefaultValue JSAPI Reference, SpiderMonkey
Renamed to JS::ToPrimitive from JSAPI 44.
228 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.
229 JS_DefineElement JSAPI Reference, SpiderMonkey
JS_DefineElement defines a numeric property for a specified object, obj.
230 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.
231 JS_DefineFunctions JSAPI Reference, Reference, Référence(2), 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.
232 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.
233 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).
234 JS_DefineProperties JSAPI Reference, SpiderMonkey
JS_DefineProperties creates properties on a specified object, obj.
235 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.
236 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.
237 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.
238 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.
239 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.
240 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.
241 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.
242 JS_DestroyIdArray JSAPI Reference, SpiderMonkey
JS_DestroyIdArray frees the ID array pointed to by ida.
243 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.
244 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.
245 JS_DoubleIsInt32 JSAPI Reference, SpiderMonkey
JS_DoubleIsInt32 returns true if d i sequal to *ip.
246 JS_DoubleToInt32 JSAPI Reference, Obsolete, SpiderMonkey
JS_DoubleToInt32 converts a C floating-point number of type double to int32, a signed 32-bit integer.
247 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.
248 JS_DumpHeap JSAPI Reference, Obsolete, SpiderMonkey
See bug 378261 for detail.
249 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:
250 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.
251 JS_EncodeString JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_EncodeString and JS_EncodeStringToUTF8 convert the specified JavaScript str to a C string (an array of 8-bit chars).
252 JS_EncodeStringToBuffer JSAPI Reference, Reference, Référence(2), 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.
253 JS_EnterCompartment JSAPI Reference, SpiderMonkey
No summary!
254 JS_EnterCrossCompartmentCall JSAPI Reference, Obsolete, SpiderMonkey
No summary!
255 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.
256 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.
257 JS_EnumerateDiagnosticMemoryRegions JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_EnumerateDiagnosticMemoryRegions enumerates memory regions that contain diagnostic information intended to be included in crash report minidumps.
258 JS_EnumerateResolvedStandardClasses JSAPI Reference, Obsolete, Reference, Référence(2), 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.
259 JS_EnumerateStandardClasses JSAPI Reference, Reference, Référence(2), 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.
260 JS_ErrorFromException JSAPI Reference, Reference, Référence(2), 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.
261 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.
262 JS_EvaluateScriptForPrincipals JSAPI Reference, Obsolete, SpiderMonkey
No summary!
263 JS_ExecuteRegExp JSAPI Reference, SpiderMonkey
JS_ExecuteRegExp and JS_NewRegExpObjectNoStatics execute the RegExp object, reobj, to the specified input string, chars, from *indexp index.
264 JS_ExecuteScript JSAPI Reference, SpiderMonkey
JS_ExecuteScript executes a previously-compiled script, script.
265 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.
266 JS_ExecuteScriptVersion JSAPI Reference, Obsolete, SpiderMonkey
JS_ExecuteScript executes a previously-compiled script, script.
267 JS_FORGET_STRING_FLATNESS JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_FORGET_STRING_FLATNESS converts JSFlatString * to JSString *.
268 JS_FS JSAPI Reference, SpiderMonkey
Use these macros to define an array of JSFunctionSpecs to pass to JS_DefineFunctions or JS_InitClass.
269 JS_FileEscapedString JSAPI Reference, Reference, Référence(2), 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.
270 JS_Finish JSAPI Reference, Obsolete, SpiderMonkey
JS_Finish is obsolete. Use JS_DestroyRuntime instead.
271 JS_FlattenString JSAPI, JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_FlattenString flattens a string str and returns a pointer to JSFlatString.
272 JS_FlushCaches JSAPI Reference, NeedsContent, SpiderMonkey
.
273 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.
274 JS_ForwardGetPropertyTo JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_ForwardGetPropertyTo is the base implementation of JS_GetProperty, JS_GetUCProperty, JS_GetPropertyById etc, where onBehalfOf is same to obj.
275 JS_FreezeObject JSAPI Reference, Reference, Référence(2), 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.
276 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.
277 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.
278 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.
279 JS_GetArrayPrototype JSAPI Reference, SpiderMonkey
JS_GetArrayPrototype() retrieves the original Array.prototype of a specified object, obj. If an error occurs, it returns NULL.
280 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.
281 JS_GetClassObject JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_GetClassObject gets the builtin class costructor for the specified prototype key.
282 JS_GetClassPrototype JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_GetClassPrototype gets the builtin class costructor for the specified prototype key.
283 JS_GetCompartmentPrivate JSAPI Reference, SpiderMonkey
Please provide a description for this function.
284 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.
285 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.
286 JS_GetContextThread JSAPI Reference, SpiderMonkey
Returns the ID of the associated thread for a context.
287 JS_GetDefaultFreeOp JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_GetDefaultFreeOp returns default JSFreeOp for the runtime.
288 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.
289 JS_GetEmptyString JSAPI, JSAPI Reference, Reference, Référence(2), SpiderMonkey
The returned empty string has the length 0.
290 JS_GetEmptyStringValue JSAPI Reference, SpiderMonkey
JS_GetEmptyStringValue returns the empty string as a JS::Value.
291 JS_GetErrorPrototype JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_GetErrorPrototype returns the original value of Error.prototype from the global object of the current compartment of cx.
292 JS_GetExternalStringClosure JSAPI, JSAPI Reference, Obsolete, Reference, Référence(2), SpiderMonkey
To determine if a string was created as an external string, you can call JS_IsExternalString.
293 JS_GetExternalStringFinalizer JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_GetExternalStringFinalizer returns the fin parameter passed to JS_NewExternalString.
294 JS_GetFlatStringChars JSAPI, JSAPI Reference, Obsolete, Reference, Référence(2), SpiderMonkey
No summary!
295 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).
296 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.
297 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.
298 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.
299 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.
300 JS_GetFunctionObject JSAPI Reference, SpiderMonkey
JS_GetFunctionObject returns the JavaScript Function object for a specified function pointer, fun.
301 JS_GetFunctionPrototype JSAPI Reference, SpiderMonkey
JS_GetFunctionPrototype() retrieves the original Function.prototype of a specified object, obj. If an error occurs, it returns NULL.
302 JS_GetFunctionScript JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_GetFunctionScript returns a pointer to JSScript for the specified function, fun. If fun is a native function, it returns NULL.
303 JS_GetGCParameter JSAPI Reference, SpiderMonkey
JS_GetGCParameter returns the current parameter of the garbage collection.
304 JS_GetGlobalForCompartmentOrNull JSAPI Reference, Reference, Référence(2), 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.
305 JS_GetGlobalForObject JSAPI Reference, SpiderMonkey
JS_GetGlobalForObject returns the last non-null object on the parent chain of the input object.
306 JS_GetGlobalForObject3
This page was auto-generated because a user created a sub-page to this page.
307 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.
308 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.
309 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.
310 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.
311 JS_GetInternedStringChars JSAPI Reference, Obsolete, SpiderMonkey
JS_GetInternedStringChars returns a pointer to the interned string.
312 JS_GetLatin1FlatStringChars JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_GetLatin1FlatStringChars and JS_GetTwoByteFlatStringChars return a pointer to the string.
313 JS_GetLatin1InternedStringChars JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_GetLatin1InternedStringChars and JS_GetTwoByteInternedStringChars gets the characters of the string, str.
314 JS_GetLatin1StringCharsAndLength JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_GetLatin1StringCharsAndLength and JS_GetTwoByteStringCharsAndLength get the characters and the length of the string, str.
315 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.
316 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).
317 JS_GetObjectPrototype JSAPI Reference, SpiderMonkey
JS_GetObjectPrototype() retrieves the original Object.prototype of a specified object, obj. If an error occurs, it returns NULL.
318 JS_GetObjectRuntime JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_GetObjectRuntime retrieves a pointer to the JSRuntime for a specified JSObject.
319 JS_GetOptions JSAPI Reference, Obsolete, SpiderMonkey
JS_GetOptions retrieves the option flags of a given JS context cx.
320 JS_GetOwnPropertyDescriptor JSAPI Reference, Reference, Référence(2), 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.
321 JS_GetParent JSAPI Reference, Obsolete, SpiderMonkey
JS_GetParent retrieves the parent object of obj, or NULL if obj does not have a parent.
322 JS_GetParentRuntime JSAPI Reference, Reference, Référence(2), 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.
323 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.
324 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.
325 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.
326 JS_GetProperty JSAPI Reference, Reference, Référence(2), 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.
327 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.
328 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.
329 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.
330 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.
331 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.
332 JS_GetRegExpFlags JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_GetRegExpFlags returns flags of the specified object, obj.
333 JS_GetRegExpSource JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_GetRegExpSource returns a source string of the specified object, obj.
334 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.
335 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.
336 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.
337 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.
338 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.
339 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.
340 JS_GetStringCharAt JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_GetStringCharAt and JS_GetFlatStringCharAt get the specified character from the string str.
341 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:
342 JS_GetStringCharsAndLength JSAPI Reference, Obsolete, SpiderMonkey
JS_GetStringCharsAndLength gets the characters and the length of the string, str
343 JS_GetStringEncodingLength JSAPI Reference, Reference, Référence(2), 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.
344 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).
345 JS_GetTwoByteExternalStringChars JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_GetTwoByteExternalStringChars gets the characters of the string, str.
346 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:
347 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.
348 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.
349 JS_HasElement JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_HasElement examines a specified JS object, obj, and its prototype chain, for an element or numeric property numbered index.
350 JS_HasInstance JSAPI Reference, Reference, Référence(2), 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.
351 JS_HasOwnProperty JSAPI Reference, SpiderMonkey
JS_HasOwnProperty searches an object, obj, for an own property with the specified name. It behaves like the JavaScript expression Object.hasOwnProperty(obj, name). JS_HasOwnPropertyById is the same but takes a JS::HandleId for the property name.
352 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.
353 JS_IdArrayGet JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_IdArrayGet gets the item in the specified index of the ID array pointed to by ida.
354 JS_IdArrayLength JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_IdArrayLength gets the length of the ID array pointed to by ida.
355 JS_IdToProtoKey JSAPI Reference, Reference, Référence(2), 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.
356 JS_IdToValue JSAPI Reference, Reference, Référence(2), 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.
357 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.
358 JS_InitCTypesClass JSAPI, JSAPI Reference, NeedsContent, Reference, Référence(2), SpiderMonkey
Initialize the ctypes object on a global object. The ctypes object will be frozen.
359 JS_InitClass JSAPI Reference, SpiderMonkey
JS_InitClass initializes a JSClass and (optionally) makes it visible to JavaScript code.
360 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:
361 JS_InstanceOf JSAPI Reference, Reference, 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.
362 JS_InternJSString JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_InternJSString converts a string str to interned string (interned atom) and returns the result string as JSString *.
363 JS_InternString JSAPI Reference, SpiderMonkey
No summary!
364 JS_IsArrayObject JSAPI Reference, SpiderMonkey
JS_IsArrayObject determines if a specified object, obj or value, is an Array object.
365 JS_IsAssigning JSAPI Reference, Obsolete, Reference, Référence(2), 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.
366 JS_IsBuiltinEvalFunction JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_IsBuiltinEvalFunction returns whether the given function is the global eval function.
367 JS_IsBuiltinFunctionConstructor JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS::IsCallable returns whether the given function is the global Function constructor.
368 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.
369 JS_IsConstructing_PossiblyWithGivenThisObject JSAPI, JSAPI Reference, Obsolete, Reference, Référence(2), 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.
370 JS_IsConstructor JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_IsConstructor determines if a specified function, fun is a valid constructor object. If so, JS_IsConstructor returns true. Otherwise it returns false.
371 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
372 JS_IsExtensible JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_IsExtensible queries [[Extensible]] property of the specified object, obj.
373 JS_IsExternalString JSAPI, JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_IsExternalString returns true if the string is an external string; otherwise it's false.
374 JS_IsGlobalObject JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_IsGlobalObject returns true if obj is a global object, false otherwise.
375 JS_IsIdentifier JSAPI Reference, Reference, Référence(2), 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.
376 JS_IsNative JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_IsNative returns true if the object is a native object.
377 JS_IsNativeFunction JSAPI Reference, Reference, Référence(2), 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.
378 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.
379 JS_IsStopIteration JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_IsStopIteration returns true if v is StopIteration, otherwise false.
380 JS_IterateCompartments JSAPI Reference, Reference, Référence(2), 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.
381 JS_LeaveCompartment JSAPI Reference, SpiderMonkey
No summary!
382 JS_LeaveCrossCompartmentCall JSAPI Reference, Obsolete, SpiderMonkey
No summary!
383 JS_LeaveLocalRootScope JSAPI Reference, Obsolete, SpiderMonkey
See JS_EnterLocalRootScope for an explanation of local root scopes.
384 JS_LeaveLocalRootScopeWithResult JSAPI Reference, Obsolete, SpiderMonkey
See JS_EnterLocalRootScope for an explanation of local root scopes.
385 JS_LinkConstructorAndPrototype JSAPI Reference, Reference, Référence(2), 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.
386 JS_Lock JSAPI Reference, SpiderMonkey
Lock the JS run-time environment.
387 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.
388 JS_LookupElement JSAPI Reference, Obsolete, SpiderMonkey
JS_LookupElement examines a specified JavaScript object, obj, for a numeric property numbered index.
389 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:
390 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.
391 JS_MakeStringImmutable JSAPI Reference, Obsolete, SpiderMonkey
A string's characters can never be changed, but SpiderMonkey uses two string optimization techniques behind the scenes:
392 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.
393 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.
394 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.
395 JS_NewArrayObject JSAPI Reference, Reference, Référence(2), 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.
396 JS_NewCompartmentAndGlobalObject JSAPI Reference, Obsolete, SpiderMonkey
No summary!
397 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.
398 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.
399 JS_NewDateObjectMsec Date, JSAPI, JSAPI Reference, SpiderMonkey
The returned JSObject is a standard JavaScript Date.
400 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).
401 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.
402 JS_NewDoubleValue JSAPI Reference, Obsolete, SpiderMonkey
JS_NewDoubleValue creates a floating-point jsval.
403 JS_NewExternalString JSAPI Reference, Reference, Référence(2), 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.
404 JS_NewFunction JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_NewFunction creates a new JavaScript function implemented in C/C++. (To create a new function implemented in JavaScript, use JS_CompileFunction instead.)
405 JS_NewGlobalObject JSAPI, JSAPI Reference
JS_NewGlobalObject creates a new global object based on the specified class.
406 JS_NewNumberValue JSAPI Reference, Obsolete, SpiderMonkey
JS_NewNumberValue converts a C floating-point number of type jsdouble to jsval, the type of JavaScript values.
407 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.
408 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.
409 JS_NewPlainObject JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_NewPlainObject creates a new plain object, like new Object(), with Object.prototype as [[Prototype]].
410 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.)
411 JS_NewRegExpObject JSAPI Reference, Reference, Référence(2), 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.
412 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.
413 JS_NewScriptObject JSAPI Reference, Obsolete, SpiderMonkey
JS_NewScriptObject returns the script object associated with the given JSScript.
414 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.
415 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.
416 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.
417 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.
418 JS_Now JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_Now returns microseconds since the epoch, midnight, January 1, 1970 UTC.
419 JS_NumberValue JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_NumberValue converts a C floating-point number of type double to JS::Value, the type of JavaScript values.
420 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.
421 JS_ObjectIsFunction JSAPI Reference, Reference, Référence(2), 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).
422 JS_ObjectIsRegExp JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_ObjectIsRegExp determines if a specified object, obj, is a RegExp object. If so, JS_ObjectIsRegExp returns true. Otherwise it returns false.
423 JS_PSGS JSAPI Reference, Reference, Référence(2), SpiderMonkey
These macros encapsulate the definition of JSNative-backed JSPropertySpecs, by defining the JSNativeWrappers for them.
424 JS_ParseJSON
Parse a string using the JSON syntax described in ECMAScript 5 and return the corresponding value.
425 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).
426 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.
427 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.
428 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.
429 JS_PutEscapedString JSAPI Reference, Reference, Référence(2), 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.
430 JS_Remove*Root JSAPI Reference, Obsolete, SpiderMonkey
JS_RemoveRoot removes the variable that rp points to from the garbage collector's root set.
431 JS_RemoveExternalStringFinalizer JSAPI Reference, Obsolete, SpiderMonkey
Remove finalizer from the global GC finalizers table, returning its type code if found, -1 if not found.
432 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.
433 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.
434 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.
435 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.
436 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.
437 JS_ResolveStandardClass JSAPI Reference, Reference, Référence(2), 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.
438 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.
439 JS_SET_TRACING_DETAILS JSAPI Reference, SpiderMonkey
Set debugging information about the next thing to be traced by a JSTracer.
440 JS_SameValue JSAPI Reference, Reference, Référence(2), 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:
441 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.
442 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.
443 JS_ScheduleGC JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_ScheduleGC sets the nextScheduled parameter of GC.
444 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.
445 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.
446 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.
447 JS_SetBranchCallback JSAPI Reference, Obsolete, SpiderMonkey
If the callback returns JS_TRUE, the JS engine continues to execute the script.
448 JS_SetCallReturnValue2 JSAPI Reference, Obsolete, SpiderMonkey
Calling JS_SetCallReturnValue2 indicates to the runtime that the native will return a value of type Reference.
449 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.
450 JS_SetCompartmentNameCallback JSAPI Reference, Reference, Référence(2), 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>.
451 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.
452 JS_SetDefaultLocale JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_SetDefaultLocale sets the default locale for the ECMAScript Internationalization API (Intl.Collator, Intl.NumberFormat, Intl.DateTimeFormat).
453 JS_SetDestroyCompartmentCallback JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_SetDestroyCompartmentCallback sets callback function which will be called when sweeping each compartment of the runtime, before deleting the compartment.
454 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.
455 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
456 JS_SetExtraGCRoots JSAPI Reference, SpiderMonkey
Register externally maintained GC roots.
457 JS_SetFunctionCallback JSAPI Reference, Obsolete, SpiderMonkey
JS_SetFunctionCallback sets a C function to be called each time a JavaScript function is invoked or exits.
458 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.
459 JS_SetGCParametersBasedOnAvailableMemory JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_SetGCParametersBasedOnAvailableMemory adjusts the parameters of the garbage collection based on available memory.
460 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.
461 JS_SetGlobalObject JSAPI Reference, Obsolete, SpiderMonkey
This function is obsolete; see also JS_GetGlobalObject.
462 JS_SetICUMemoryFunctions
Sets the memory allocation and deallocation functions used by the ICU internationalization library.
463 JS_SetInterruptCallback JSAPI_Reference, Reference, 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.
464 JS_SetNativeStackQuota JSAPI Reference, Reference, Référence(2), SpiderMonkey
No summary!
465 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.
466 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.
467 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.
468 JS_SetParent JSAPI Reference, Obsolete, SpiderMonkey
JS_SetParent sets an object's parent.
469 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.
470 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.
471 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.
472 JS_SetProperty JSAPI Reference, Reference, Référence(2), 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.
473 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.
474 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.
475 JS_SetRegExpInput JSAPI Reference, Reference, Référence(2), 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.
476 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.
477 JS_SetThreadStackLimit JSAPI Reference, Obsolete, SpiderMonkey
No summary!
478 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.
479 JS_SetVersionForCompartment JSAPI Reference, Reference, Référence(2), 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.
480 JS_ShutDown JSAPI Reference, SpiderMonkey
Destroys all free-standing resources allocated by SpiderMonkey, not associated with any JSRuntime, JSContext, or other structure.
481 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.
482 JS_StringEqualsAscii JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_StringEqualsAscii and JS_FlatStringEqualsAscii compare string str and ASCII string asciiBytes.
483 JS_StringHasBeenInterned JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_StringHasBeenInterned returns true if the string str is interned.
484 JS_StringHasLatin1Chars JSAPI, JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_StringHasLatin1Chars returns true iff the string's characters are stored as Latin1.
485 JS_StringIsFlat JSAPI, JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_StringIsFlat returns true if the string is flattened.
486 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:
487 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.
488 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.
489 JS_ThrowStopIteration JSAPI Reference, SpiderMonkey
JS_ThrowStopIteration throws the appropriate StopIteration object for the function currently executing in cx.
490 JS_ToggleOptions JSAPI Reference, Obsolete, SpiderMonkey
JS_ToggleOptions toggles context-wide options. It is equivalent to JS_SetOptions(cx, JS_GetOptions(cx) ^ options).
491 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.
492 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.
493 JS_Unlock JSAPI Reference, SpiderMonkey
Unlock a previously locked JS run-time environment.
494 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.
495 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.
496 JS_ValueToFunction JSAPI Reference, SpiderMonkey
Convert a JS::Value to a JSFunction.
497 JS_ValueToId JSAPI Reference, Reference, Référence(2), 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.
498 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.
499 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.
500 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.
501 JS_ValueToSource JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_ValueToSource converts a specified JavaScript value, v, to a JavaScript source.
502 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.
503 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:
504 JS_YieldRequest JSAPI_Reference, SpiderMonkey
Momentarily suspend the current JSAPI request, allowing garbage collection to run if another thread has requested it.
505 JS_freeop JSAPI Reference, Reference, Référence(2), 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.
506 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.
507 JS_updateMallocCounter JSAPI Reference, Reference, Référence(2), SpiderMonkey
JS_updateMallocCounter decrements malloc counter of GC and the zone of the context.
508 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.
509 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.
510 Property attributes Attribute, JSAPI Reference, Reference, Référence(2), 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.
511 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.
512 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.
513 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.)
514 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.
515 jsid JSAPI Reference, Reference, Référence(2), SpiderMonkey
jsid is either a 31-bit signed integer, interned string or object.
516 jsint JSAPI Reference, Obsolete, SpiderMonkey
jsint and jsuint are 32-bit integer types.
517 JSDBGAPI JavaScript, SpiderMonkey
These functions can be used to profile a SpiderMonkey application using the Mac profiler, Shark. See Profiling JavaScript with Shark.
518 Parser API API, Guide, JavaScript, SpiderMonkey
Example:
519 Profiling SpiderMonkey Guide
1.) Get yourself an optimized libxul build of Firefox, with debugger info.
520 Running Automated JavaScript Tests Automated testing, Build documentation, Guide, QA, SpiderMonkey
The jstests shell harness is js/src/tests/jstests.py. Basic usage is:
521 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.
522 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.
523 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.
524 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.
525 SpiderMonkey Build Documentation Build documentation, Guide, SpiderMonkey
Use these instructions to build the latest SpiderMonkey source code.
526 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:
527 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.
528 64-bit Compatibility SpiderMonkey
The following types or typedefs are always 64-bit on 64-bit platforms, and 32-bit on 32-bit platforms:
529 Bytecode Descriptions SpiderMonkey
This document is automatically generated from Opcodes.h by make_opcode_doc.py.
530 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.
531 Functions SpiderMonkey
There are several flavors of JavaScript function. All are JSObjects of the same class, js_FunctionClass.
532 Garbage collection Guide, NeedsContent, SpiderMonkey
SpiderMonkey has a mark-sweep garbage collection (GC) with incremental marking mode, generational collection, and compaction. Much of the GC work is performed on helper threads.
533 Invariants SpiderMonkey
or, "The Zen of SpiderMonkey".
534 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.
535 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.
536 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.
537 Tracing JIT Deprecated, 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.
538 SpiderMonkey compartments Guide, NeedsContent, NeedsExample, SpiderMonkey
No summary!
539 SpiderMonkey releases SpiderMonkey
The easiest way to fetch the version corresponding to the current Firefox release is to visit the treeherder page for the release repository and click on the first SM(pkg) link you see. That will open a small window in the bottom left with a line like " mozjs-57.0.1.tar.bz2".
540 SpiderMonkey 1.8 SpiderMonkey
SpiderMonkey 1.8 has one known significant regression from 1.7.
541 SpiderMonkey 1.8.5 SpiderMonkey
SpiderMonkey 1.8.5 is supported on all the platforms where Firefox 4 runs.
542 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.
543 SpiderMonkey 1.8.8 SpiderMonkey
SpiderMonkey 1.8.8 is supported on all the platforms where Firefox INSERT-ACTUAL-FIREFOX-VERSION-NUMBER-HERE runs.
544 SpiderMonkey 17 SpiderMonkey
SpiderMonkey 17 is supported on all the platforms where Firefox 17 runs.
545 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.
546 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.
547 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.
548 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.
549 SpiderMonkey 52 JavaScript engine, Mozilla, SpiderMonkey
No summary!
550 Split object JSAPI Reference, JavaScript, SpiderMonkey
In SpiderMonkey, a split object is made up of two JSObjects: an inner object and an outer object.