Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Index

この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!

Found 546 pages:

# Page Tags and summary
1 SpiderMonkey SpiderMonkey
Standalone source code releases can be found on the Releases page.
2 Creating JavaScript tests Automated testing, Build documentation, Guide, QA, SpiderMonkey
Most new tests could go in either suite. The main differences are:
3 FOSS Guide, SpiderMonkey
Feel free to add your own SpiderMonkey-based open source projects (and if necessary add categories)!
4 Future directions Guide, Mozilla, SpiderMonkey
This article documents future directions in functionality, design, and coding practices for SpiderMonkey. It can be read as something like an "ideal future state" for the engine. That means the code as it is today won't match this document, and that's OK. Whenever practical, new code and changes should move code closer to the ideal future. And of course, the idea of the future is always evolving in time as things change and we learn more.
5 GC Rooting Guide SpiderMonkey
No summary!
6 Getting SpiderMonkey source code Guide, SpiderMonkey
You can get the SpiderMonkey source code in gzipped form or directly from the Mercurial repository.
7 Hacking Tips SpiderMonkey
This page list a few tips to help you investigate issues related to SpiderMonkey. All tips listed here are dealing with the JavaScript shell obtained at the end of the build documentation of SpiderMonkey. It is separated in 2 parts, one section related to debugging and another section related to drafting optimizations. Many of these tips only apply to debug builds of the JS shell; they will not function in a release build.
8 How to embed the JavaScript engine Embedding Mozilla, JavaScript, SpiderMonkey, Tutorial
See also JSAPI User Guide. In particular, it has more and better code examples!
9 Index Index, MDN Meta, SpiderMonkey
Found 546 pages:
10 Introduction to the JavaScript shell SpiderMonkey
To get the SpiderMonkey JavaScript shell, see the SpiderMonkey Build Documentation or download a compiled binary for your platform from the Nightly Builds.
11 JIT Optimization Outcomes
SpiderMonkey's optimizing JIT, IonMonkey, uses different optimization strategies to speed up various operations. The most typical operations that are relevant for fast program execution are property accesses and function calls.
12 JIT Optimization Strategies SpiderMonkey
SpiderMonkey's optimizing JIT, IonMonkey, uses various strategies to optimize operations. The most commonplace operations that are relevant for fast program execution are property accesses and function calls.
13 JSAPI Cookbook SpiderMonkey
This article shows the JSAPI equivalent for a tiny handful of common JavaScript idioms.
14 JSAPI User Guide JSAPI, SpiderMonkey
This document explains how to embed SpiderMonkey, the Mozilla JavaScript engine, in your C++ program.
15 JSAPI reference NeedsContent, SpiderMonkey
The JSAPI is the C++ API for the SpiderMonkey JavaScript engine. To learn how to use the JSAPI, see the JSAPI User Guide and the JSAPI Cookbook.
16 BOOLEAN_TO_JSVAL JSAPI Reference, Obsolete, SpiderMonkey
BOOLEAN_TO_JSVAL converts a bool argument, b, to a boolean jsval.
17 DOUBLE_TO_JSVAL JSAPI Reference, Obsolete, SpiderMonkey
DOUBLE_TO_JSVAL is the inverse of JS::ToNumber.
18 INT_FITS_IN_JSVAL JSAPI Reference, Obsolete, SpiderMonkey
Determines if a specified C integer value, i, lies within the range allowed for integer jsvals. If so, INT_FITS_IN_JSVAL returns TRUE, and i can be cast to jsval by calling INT_TO_JSVAL(i). Otherwise, INT_FITS_IN_JSVAL returns FALSE. In this case, the application can still convert i to a jsval using JS_NewNumberValue.
19 INT_TO_JSVAL JSAPI Reference, Obsolete, SpiderMonkey
INT_TO_JSVAL converts a C integer, i, to a jsval.
20 JS::Add*Root JSAPI Reference, NeedsContent, Obsolete, Reference, Référence, SpiderMonkey
These functions are obsoleted, use JS::PersistentRooted instead.
21 JS::AutoIdArray JSAPI Reference, Reference, Référence, SpiderMonkey
JS::AutoIdArray takes the ownership of JSIdArray, and frees it in destructor by calling JS_DestroyIdArray.
22 JS::AutoSaveExceptionState JSAPI Reference, Reference, Référence, SpiderMonkey
JS::AutoSaveExceptionState saves and later restores the current exception state of a given JSContext.
23 JS::AutoValueArray JSAPI Reference, Reference, Référence, SpiderMonkey
JS::AutoValueArray<N> holds a rooted array of JS::Value. This is typically used for local variables being passed to function which requires JS::HandleValueArray or a pointer to JS::Value array.
24 JS::AutoVectorRooter JSAPI Reference, Reference, Référence, SpiderMonkey
JS::AutoVectorRooter<T> holds a variable-size rooted array of type T.
25 JS::BooleanValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
26 JS::Call JSAPI Reference, Reference, Référence, SpiderMonkey
JS::Call calls a specified function, fun, on an object, thisObj. In terms of function execution, the object is treated as this.
27 JS::CallArgs JSAPI Reference, Reference, Référence, SpiderMonkey
JS::CallArgs is helper class encapsulating access to the callee, this value, arguments, and argument count for a function call.
28 JS::CloneFunctionObject JSAPI Reference, Reference, Référence, SpiderMonkey
JS::CloneFunctionObject creates a new function object from funobj. The new object has the same code and argument list as funobj. If scopeChain is supplied, it uses scopeChain as its enclosing scope. If scopeChain is omitted, it creates a new function object in cx's global. This can be helpful if funobj is an extant function that you wish to use as if it were enclosed by a newly-created global object.
29 JS::Compile JSAPI Reference, Reference, Référence, SpiderMonkey
JS::Compile compiles a script, srcBuf, chars, bytes, or file, for execution.
30 JS::CompileFunction JSAPI Reference, Reference, Référence, SpiderMonkey
JS::CompileFunction compiles a function from a text string chars, bytes, or srcBuf.
31 JS::CompileOffThread JSAPI Reference, Reference, Référence, SpiderMonkey
JS::CompileOffThread compiles a script, chars for execution.
32 JS::CompileOptions JSAPI Reference, Reference, Référence, SpiderMonkey
Some methods of JS::OwningCompileOptions and JS::CompileOptions return the instance itself to allow method chain.
33 JS::Construct JSAPI Reference, Reference, Référence, SpiderMonkey
JS::Construct calls a specified function as a constructor, fun.
34 JS::CreateError JSAPI Reference, Reference, Référence, SpiderMonkey
JS::CreateError creates an Error object with specified properties.
35 JS::CurrentGlobalOrNull JSAPI Reference, Reference, Référence, SpiderMonkey
JS::CurrentGlobalOrNull() returns the global object for whatever function is currently running on the context. In other words, it returns the global object on the current scope chain.
36 JS::DoubleNaNValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
37 JS::DoubleValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
38 JS::Evaluate JSAPI Reference, Reference, Référence, SpiderMonkey
JS::Evaluate compiles and executes a script in the specified scope, obj or scopeChain.
39 JS::FalseValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
40 JS::Float32Value JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
41 JS::GetFirstArgumentAsTypeHint JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
42 JS::GetSelfHostedFunction JSAPI Reference, Reference, Référence, SpiderMonkey
JS::GetSelfHostedFunction creates a new JavaScript function implemented in self-hosted JavaScript.
43 JS::Handle JSAPI Reference, Reference, Référence, SpiderMonkey
Here, ptr represents the private member of JS::Handle<T>, typed with T.
44 JS::HandleValueArray JSAPI Reference, Reference, Référence, SpiderMonkey
JS::HandleValueArray is a handle to an array of rooted values. This is useful as a parameter type, or a temporal local variable for it.
45 JS::IdentifyStandardInstance JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
46 JS::Int32Value JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
47 JS::IsCallable JSAPI Reference, Reference, Référence, SpiderMonkey
JS::IsCallable returns whether the given function object is callable.
48 JS::MutableHandle JSAPI Reference, Reference, Référence, SpiderMonkey
Here, ptr represents the private member of JS::MutableHandle<T>, typed with T *.
49 JS::NewFunctionFromSpec JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
50 JS::NullHandleValue JSAPI Reference, Reference, Référence, SpiderMonkey
JS::NullHandleValue is a JS::HandleValue constant that represents the JavaScript value null.
51 JS::NullValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
52 JS::NumberValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
53 JS::ObjectOrNullValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
54 JS::ObjectValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
55 JS::OrdinaryToPrimitive JSAPI Reference, Reference, Référence, SpiderMonkey
JS::OrdinaryToPrimitive converts a JavaScript object to a specified type value, by the algorithm specified in ES6 draft rev 28 (2014 Oct 14) 7.1.1, second algorithm.
56 JS::PersistentRooted JSAPI Reference, Reference, Référence, SpiderMonkey
Here, ptr represents the private member of JS::PersistentRooted<T>, typed with T.
57 JS::PropertySpecNameEqualsId JSAPI Reference, Reference, Référence, SpiderMonkey
JS::PropertySpecNameEqualsId determines if the given JSPropertySpec::name or JSFunctionSpec::name value equals the given jsid, and returns true if so.
58 JS::PropertySpecNameIsSymbol JSAPI Reference, Reference, Référence, SpiderMonkey
JS::PropertySpecNameIsSymbol determines if the given JSPropertySpec::name or JSFunctionSpec::name value is actually a symbol code and not a string, and returns true if so.
59 JS::PropertySpecNameToPermanentId JSAPI Reference, Reference, Référence, SpiderMonkey
JS::PropertySpecNameToPermanentId creates a jsid that does not need to be marked for GC from JSPropertySpec::name or JSFunctionSpec::name. The resulting jsid, on success, is either an interned string or a well-known symbol; either way it is immune to GC so there is no need to visit *idp during GC marking..
60 JS::ProtoKeyToId JSAPI Reference, Reference, Référence, SpiderMonkey
JS::ProtoKeyToId converts a specified JS prototype key key, to a JS ID. JS::ProtoKeyToId stores a jsid to *idp.
61 JS::Remove*Root JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
JS::Remove*Root removes the variable that rp points to from the garbage collector's root set.
62 JS::Rooted JSAPI Reference, Reference, Référence, SpiderMonkey
Here, ptr represents the private member of JS::Rooted<T>, typed with T.
63 JS::SetLargeAllocationFailureCallback JSAPI Reference, Reference, Référence, SpiderMonkey
If a large allocation fails when calling pod_{calloc,realloc}CanGC, the JS engine may call the large-allocation- failure callback, if set, to allow the embedding to flush caches, possibly perform shrinking GCs, etc. to make some room. The allocation will then be retried (and may still fail.)
64 JS::SetOutOfMemoryCallback JSAPI Reference, Reference, Référence, SpiderMonkey
Unlike the error reporter, which is only called if the exception for an OOM bubbles up and is not caught, the JS::OutOfMemoryCallback is called immediately at the OOM site to allow the embedding to capture the current state of heap allocation before anything is freed. If the large-allocation-failure callback is called at all (not all allocation sites call the large-allocation-failure callback on failure), it is called before the out-of-memory callback; the out-of-memory callback is only called if the allocation still fails after the large-allocation-failure callback has returned.
65 JS::SourceBufferHolder JSAPI Reference, Reference, Référence, SpiderMonkey
JS::SourceBufferHolder is the container class for passing in script source buffers to the JS engine. This not only groups the buffer and length values, it also provides a way to optionally pass ownership of the buffer to the JS engine without copying. Rules for use:
66 JS::StringValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
67 JS::SymbolValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
68 JS::ToBoolean JSAPI Reference, SpiderMonkey
JS::ToBoolean converts a JavaScript value to a boolean. It implements the ToBoolean operation described in ECMA 262-3 §9.2. This function can not fail and the return value is always the boolean conversion of the argument.
69 JS::ToInt32 JSAPI Reference, Reference, Référence, SpiderMonkey
JS::ToInt32 converts a JavaScript value to a signed 32bit integer. It implements the ToInt32 operator described in ECMA 262-3 §9.5.
70 JS::ToInt64 JSAPI Reference, Reference, Référence, SpiderMonkey
JS::ToInt64 converts a JavaScript value to a signed 64bit integer.
71 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.
72 JS::ToPrimitive JSAPI Reference, SpiderMonkey
JS::ToPrimitive converts a JavaScript object, obj, to a primitive value using ECMAScript 6 ToPrimitive.
73 JS::ToString JSAPI Reference, Reference, Référence, SpiderMonkey
JS::ToString returns a string representation of a JavaScript value.
74 JS::ToUint16 JSAPI Reference, Reference, Référence, SpiderMonkey
JS::ToInt16 converts a JavaScript value to an unsigned 16bit integer. It implements the ToInt16 operator described in ECMA 262-3 §9.7.
75 JS::ToUint32 JSAPI Reference, Reference, Référence, SpiderMonkey
JS::ToInt32 converts a JavaScript value to an unsigned 32bit integer. It implements the ToInt32 operator described in ECMA 262-3 §9.6.
76 JS::ToUint64 JSAPI Reference, Reference, Référence, SpiderMonkey
JS::ToInt64 converts a JavaScript value to an unsigned 64bit integer.
77 JS::TrueHandleValue JSAPI Reference, Reference, Référence, SpiderMonkey
JS::TrueHandleValue and JS::FalseHandleValue are JS::HandleValue constants that represent the JavaScript values true and false.
78 JS::TrueValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
79 JS::UndefinedHandleValue JSAPI Reference, Reference, Référence, SpiderMonkey
JS::UndefinedHandleValue is a JS::HandleValue constant that represents the JavaScript value undefined.
80 JS::UndefinedValue JSAPI Reference, Reference, Référence, SpiderMonkey
Editorial review completed.
81 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.
82 JSAutoByteString JSAPI Reference, Reference, Référence, SpiderMonkey
JSAutoByteString takes the ownership of string and frees it in destructor.
83 JSAutoCompartment JSAPI Reference, SpiderMonkey
No summary!
84 JSBool JSAPI Reference, Obsolete, SpiderMonkey
No summary!
85 JSCheckAccessOp JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
Check whether obj[id] may be accessed per mode, returning JS_FALSE on error/exception, JS_TRUE on success with obj[id]'s stored value in *vp. As for JSPropertyOp, id is either a string or an int jsval.
86 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.
87 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!
88 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:
89 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.
90 JSConvertOp JSAPI Reference, Reference, Référence, SpiderMonkey
JSConvertOp callback specifies conversion behavior for objects having this class, implementing the ECMAScript [[DefaultValue]] behavior for them. On success it must return a primitive value in *vp.
91 JSDeletePropertyOp JSAPI Reference, Reference, Référence, SpiderMonkey
JSDeletePropertyOp callback is a hook that applications may install to be called at some point during property access. A JSDeletePropertyOp may be installed on a JSClass to hook property deletes.
92 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.
93 JSErrorFormatString JSAPI Reference, Reference, Référence, SpiderMonkey
JSErrorFormatString is a struct to represent error message and type, returned by JS_ReportErrorNumber function.
94 JSErrorReport JSAPI Reference, SpiderMonkey
JSErrorReport describes a single error that occurs in the execution of script.
95 JSExceptionState JSAPI Reference, SpiderMonkey
A JSExceptionState object is returned by the JS_SaveExceptionState function, and is passed to functions JS_RestoreExceptionState and JS_DropExceptionState.
96 JSExnType JSAPI Reference, Reference, Référence, SpiderMonkey
These types are part of a JSErrorFormatString structure. They define which error to throw in case of a runtime error. JSEXN_NONE marks an unthrowable error.
97 JSExtendedClass JSAPI Reference, Obsolete, SpiderMonkey
To implement a custom class that uses any of the JSExtendedClass callbacks:
98 JSExtendedClass.outerObject JSAPI Reference, Obsolete, SpiderMonkey
See split objects.
99 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.
100 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.
101 JSFUN_GLOBAL_PARENT JSAPI Reference, Obsolete, SpiderMonkey
No summary!
102 JSFastNative JSAPI Reference, Obsolete, SpiderMonkey
No summary!
103 JSFinalizeOp JSAPI Reference, Reference, Référence, SpiderMonkey
The JSFinalizeOp is analogous to Java finalizers or C++ destructors. The garbage collector calls this callback for each object it collects. The finalizer's job is to clean up any resources allocated by the instance which wouldn't normally be cleaned up by the garbage collector (private data stored in the object by the application, file handles, etc.)
104 JSFreeOp JSAPI Reference, Reference, Référence, SpiderMonkey
Various finalization API takes not JSContext * but rather either JSFreeOp structure or its library-private counterpart FreeOp. These structures wrap parameters that are passed to the finalizers removing most of explicit dependencies on JSContext in the finalization code.
105 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 *.
106 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.
107 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.
108 JSHasInstanceOp JSAPI Reference, Reference, Référence, SpiderMonkey
JSHasInstanceOp is called to check whether v is an instance of obj. Return false on error or exception, true on success with true in *bp if v is an instance of obj, false in *bp otherwise.
109 JSID_EMPTY JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_EMPTY is an internal jsid value which is used in type inference code.
110 JSID_IS_EMPTY JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_IS_EMPTY tests whether a specified JS ID, id, is JSID_EMPTY.
111 JSID_IS_GCTHING JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_IS_GCTHING tests whether a specified JS ID, id, is a GC thing, and returns true if it's a GC thing.
112 JSID_IS_INT JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_IS_INT tests whether a specified JS ID, id, is an integer, and returns true if it's an integer.
113 JSID_IS_STRING JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_IS_STRING tests whether a specified JS ID, id, is a string, and returns true if it's a string.
114 JSID_IS_SYMBOL JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_IS_SYMBOL tests whether a specified JS ID, id, is a JS Symbol, and returns true if it's a JS Symbol.
115 JSID_IS_VOID JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_IS_VOID tests whether a specified JS ID, id, is JSID_VOID.
116 JSID_IS_ZERO JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_IS_ZERO tests whether a specified JS ID, id, is zero (0 in its integer representation).
117 JSID_VOID JSAPI Reference, Reference, Référence, SpiderMonkey
JSID_VOID does not occur in JS scripts but may be used to indicate the absence of a valid jsid. A void jsid is not a valid id and only arises as an exceptional API return value, such as in JS_NextProperty. Embeddings must not pass JSID_VOID into JSAPI entry points expecting a jsid and do not need to handle JSID_VOID in hooks receiving a jsid except when explicitly noted in the API contract.
118 JSIdArray JSAPI Reference, SpiderMonkey
JSIdArray is used to hold IDs for enumerated properties associated with an object.
119 JSIteratorOp JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
The JavaScript engine calls the JSExtendedClass.iteratorObject callback to create an iterator object for a given object. The callback should return an iterator object or NULL if an error or exception occurred on cx.
120 JSMarkOp JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
Call JS_MarkGCThing for each GC thing directly reachable from obj. Use JSVAL_IS_GCTHING to check whether a value needs to be marked and JSVAL_TO_GCTHING to convert the jsval to a pointer.
121 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.
122 JSNewEnumerateOp JSAPI Reference, Reference, Référence, SpiderMonkey
From SpiderMonkey 38, JSNewEnumerateOp is the type of ObjectOps::enumerate. This callback overrides a portion of SpiderMonkey's default [[Enumerate]] internal method. When an ordinary object is enumerated, that object and each object on its prototype chain is tested for an enumerate op, and those ops are called in order. The properties each op adds to the properties vector are added to the set of values the for-in loop will iterate over. All of this is nonstandard.
123 JSNewResolveOp JSAPI Reference, Obsolete, SpiderMonkey
Like JSResolveOp, but flags provide contextual information about the property access.
124 JSObject JSAPI Reference, SpiderMonkey
Objects are made up of the following parts:
125 JSObjectOp JSAPI Reference, Obsolete, SpiderMonkey
The callbacks of this type are:
126 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]].
127 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.
128 JSObjectOps.destroyObjectMap JSAPI Reference, Obsolete, SpiderMonkey
No summary!
129 JSObjectOps.dropProperty JSAPI Reference, Obsolete, SpiderMonkey
The following contract governs JSObjectOps callers and implementations:
130 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.
131 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.
132 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.
133 JSObjectOps.getRequiredSlot JSAPI Reference, Obsolete, SpiderMonkey
Get and set a required slot, one that should already have been allocated. These operations are infallible, so required slots must be pre-allocated, or implementations must suppress out-of-memory errors. The native ops (js_ObjectOps, see js/src/jsobj.c) access slots reserved by including a call to the JSCLASS_HAS_RESERVED_SLOTS(n) macro in the JSClass.flags initializer.
134 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.
135 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.
136 JSObjectOps.setProto JSAPI Reference, Obsolete, SpiderMonkey
These hooks must check for cycles without deadlocking, and otherwise take special steps. See js_SetPrototype or js_SetParent in js/src/jsobj.c for an example.
137 JSObjectPrincipalsFinder JSAPI Reference, Obsolete, SpiderMonkey
The JavaScript engine calls this callback to obtain principals for a JSPrincipals.subsume check.
138 JSPRINCIPALS_HOLD JSAPI Reference, Obsolete, SpiderMonkey
JSPRINCIPALS_HOLD and JSPRINCIPALS_DROP are used to manage memory for JSPrincipals objects.
139 JSPrincipals JSAPI Reference, Reference, Référence, SpiderMonkey
JSPrincipals is the abstract base class of all principals objects, the objects that identify the source of a function or script and are used to determine its privileges. A principals object is like a Java CodeSource.
140 JSPrincipalsTranscoder
JSPrincipalsTranscoder is the type of a security callback that can be configured using JS_SetPrincipalsTranscoderJSAPI 1.8 and earlier or JS_SetRuntimeSecurityCallbacksAdded in SpiderMonkey 1.8.1.
141 JSProperty JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
JSProperty is the abstract base class of all object properties. It is used internally in JSObjectOps.lookupProperty, getAttributes, setAttributes, and dropProperty.
142 JSPropertyDescriptor JSAPI Reference, Reference, Référence, SpiderMonkey
The JSPropertyDescriptor holds the object that has the property, attributes of the property, getter and setter operations, and the value.
143 JSPropertyOp JSAPI Reference, SpiderMonkey
They are also the types of the JSClass.addProperty, getProperty, and setProperty callbacks, which are called during object property accesses.
144 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.
145 JSProtoKey JSAPI Reference, Reference, Référence, SpiderMonkey
Each of these types corresponds to standard objects in JavaScript. Some of them are Nightly only (depends on each option).
146 JSReserveSlotsOp JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
JSClass offers the following hook:
147 JSResolveOp JSAPI Reference, Reference, Référence, SpiderMonkey
JSResolveOp callback is a hook which is called when a property is not found on an object.
148 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.
149 JSSecurityCallbacks.contentSecurityPolicyAllows
Editorial review completed.
150 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.
151 JSStringFinalizer JSAPI Reference, Reference, Référence, SpiderMonkey
JSStringFinalizer::finalize finalizes external strings created by JS_NewExternalString.
152 JSTraceOp JSAPI Reference, Reference, Référence, SpiderMonkey
JSTraceOp is the function type for trace operation of the class called to enumerate all traceable things reachable from obj's private data structure. For each such thing, a trace implementation must call one of the JS_Call*Tracer variants on the thing.
153 JSType JSAPI Reference, SpiderMonkey
No summary!
154 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).
155 JSVAL_IS_DOUBLE JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_DOUBLE(v) is true if v is a number represented in memory as a jsdouble.
156 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.
157 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.
158 JSVAL_IS_NULL JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_NULL(v) is true if v is JSVAL_NULL, which is the JavaScript null value.
159 JSVAL_IS_NUMBER JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_NUMBER(v) is true if v is a JavaScript number.
160 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.
161 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.
162 JSVAL_IS_STRING JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_STRING(v) is true if v is a string.
163 JSVAL_IS_VOID JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_IS_VOID(v) is true if v is JSVAL_VOID, which represents the JavaScript value undefined.
164 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.
165 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).
166 JSVAL_ONE JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_ONE is equivalent to INT_TO_JSVAL(1).
167 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.
168 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.
169 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 *.
170 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.
171 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.
172 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.
173 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.
174 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.
175 JSVAL_VOID JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_VOID is a jsval constant that represents the JavaScript value undefined.
176 JSVAL_ZERO JSAPI Reference, Obsolete, SpiderMonkey
JSVAL_ZERO is equivalent to INT_TO_JSVAL(0).
177 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.
178 JSXDRObjectOp JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
Serialize or deserialize an object, given an XDR state record representing external data. See jsxdrapi.h.
179 JS_ASSERT_STRING_IS_FLAT JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ASSERT_STRING_IS_FLAT asserts the string is flattened, and returns a pointer to JSFlatString.
180 JS_Add*Root JSAPI Reference, Obsolete, SpiderMonkey
These functions are obsoleted, use JS::PersistentRooted instead.
181 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.)
182 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).
183 JS_AddFinalizeCallback JSAPI Reference, Reference, Référence, SpiderMonkey
JS_AddFinalizeCallback add a callback function which the garbage collector calls at several points during garbage collection. rt is the runtime in which you specify the callback. cb is a pointer to the callback function to add.
184 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.
185 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.
186 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.
187 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.
188 JS_BindCallable JSAPI Reference, Reference, Référence, SpiderMonkey
JS_BindCallable binds the given callable to use the given object as this.
189 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.
190 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.
191 JS_CallFunction JSAPI Reference, SpiderMonkey
Calls a specified JS function.
192 JS_CheckAccess JSAPI Reference, SpiderMonkey
Check whether a running script may access a given object property.
193 JS_CheckForInterrupt JSAPI_Reference, Reference, Référence, SpiderMonkey
JS_CheckForInterrupt checks for the interrupt, and handle it if it's pending. JS_CheckForInterrupt returns false if interrupt callback returns false.
194 JS_ClearContextThread JSAPI Reference, SpiderMonkey
These functions have been removed.  Each JSRuntime (and, implicitly, the JSContext that is created under it) tmust only be used on the thread that created it.
195 JS_ClearDateCaches Date, JSAPI Reference, JavaScript, Reference, Référence, SpiderMonkey
JS_ClearDateCaches clears the cache of calculated local time from each Date object. Call to propagate a system timezone change.
196 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.
197 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.
198 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.)
199 JS_ClearRegExpStatics JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ClearRegExpStatics clears the pending input string and flags of the built-in RegExp object.
200 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.
201 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.
202 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.
203 JS_CompileFileHandleForPrincipals JSAPI Reference, NeedsContent, Obsolete, SpiderMonkey
Please provide a description of this function.
204 JS_CompileFileHandleForPrincipalsVersion JSAPI Reference, NeedsContent, Obsolete, SpiderMonkey
Please provide a description for this function.
205 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.
206 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.
207 JS_CompileScript JSAPI Reference, SpiderMonkey
JS_CompileScript compiles a script, source, for execution. JS_CompileUCScript is the Unicode version of the function.
208 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.
209 JS_CompileUCFunctionForPrincipalsVersion JSAPI Reference, NeedsContent, Obsolete, SpiderMonkey
Please provide a description for this function.
210 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.
211 JS_CompileUTF8FileHandle JSAPI Reference, Obsolete, SpiderMonkey
No summary!
212 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.
213 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.
214 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.
215 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.
216 JS_ConvertArgumentsVA JSAPI Reference, Obsolete, SpiderMonkey
JS_ConvertArgumentsVA is to JS_ConvertArguments as vprintf is to printf. See JS_ConvertArguments for further information.
217 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.
218 JS_DecompileFunction JSAPI Reference, SpiderMonkey
JS_DecompileFunction generates the complete source code of a function declaration from a function's compiled form, fun.
219 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.
220 JS_DecompileScript JSAPI Reference, Reference, Référence, SpiderMonkey
JS_DecompileScript returns the source code of script. If script is a function, it calls JS_DecompileFunction. Otherwise, it returns the original source code of the script. If the script is not cached, it tries to load the source from file, and returns nullptr if an error happened while loading.
221 JS_DecompileScriptObject JSAPI Reference, NeedsContent, SpiderMonkey
FIXME: Please provide a description for this function.
222 JS_DeepFreezeObject JSAPI Reference, Reference, Référence, SpiderMonkey
JS_DeepFreezeObject freezes obj, and all objects it refers to, recursively. This will not recurse through non-extensible objects, on the assumption that those are already deep-frozen.
223 JS_DefaultValue JSAPI Reference, SpiderMonkey
Renamed to JS::ToPrimitive from JSAPI 44.
224 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.
225 JS_DefineElement JSAPI Reference, SpiderMonkey
JS_DefineElement defines a numeric property for a specified object, obj.
226 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.
227 JS_DefineFunctions JSAPI Reference, Reference, Référence, SpiderMonkey
JS_DefineFunctions creates zero or more functions and makes them properties (methods) of a specified object, obj, as if by calling JS_DefineFunction repeatedly.
228 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.
229 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).
230 JS_DefineProperties JSAPI Reference, SpiderMonkey
JS_DefineProperties creates properties on a specified object, obj.
231 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.
232 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.
233 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.
234 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.
235 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.
236 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.
237 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.
238 JS_DestroyIdArray JSAPI Reference, SpiderMonkey
JS_DestroyIdArray frees the ID array pointed to by ida.
239 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.
240 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.
241 JS_DoubleIsInt32 JSAPI Reference, SpiderMonkey
JS_DoubleIsInt32 returns true if d i sequal to *ip.
242 JS_DoubleToInt32 JSAPI Reference, Obsolete, SpiderMonkey
JS_DoubleToInt32 converts a C floating-point number of type double to int32, a signed 32-bit integer.
243 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.
244 JS_DumpHeap JSAPI Reference, Obsolete, SpiderMonkey
See bug 378261 for detail.
245 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:
246 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.
247 JS_EncodeString JSAPI Reference, Reference, Référence, SpiderMonkey
JS_EncodeString and JS_EncodeStringToUTF8 convert the specified JavaScript str to a C string (an array of 8-bit chars).
248 JS_EncodeStringToBuffer JSAPI Reference, Reference, Référence, SpiderMonkey
JS_EncodeStringToBuffer converts the specified JavaScript str to a C string (an array of 8-bit chars) and fills the specified buffer with up to length bytes of the string in UTF-8 format. 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.
249 JS_EnterCompartment JSAPI Reference, SpiderMonkey
No summary!
250 JS_EnterCrossCompartmentCall JSAPI Reference, Obsolete, SpiderMonkey
No summary!
251 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.
252 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.
253 JS_EnumerateDiagnosticMemoryRegions JSAPI Reference, Reference, Référence, SpiderMonkey
JS_EnumerateDiagnosticMemoryRegions enumerates memory regions that contain diagnostic information intended to be included in crash report minidumps.
254 JS_EnumerateResolvedStandardClasses JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
JS_EnumerateResolvedStandardClasses enumerates any already-resolved standard class ids into ida, or into a new JSIdArray if ida is NULL. Return the augmented array on success, NULL on failure with ida (if it was non-null on entry) destroyed.
255 JS_EnumerateStandardClasses JSAPI Reference, Reference, Référence, SpiderMonkey
The global object's class's enumerate op should call JS_EnumerateStandardClasses(cx, obj), to define eagerly during for...in loops any classes not yet resolved lazily.
256 JS_ErrorFromException JSAPI Reference, Reference, Référence, SpiderMonkey
If obj is an exception object, the exception will have (or be able to lazily create) an error report struct, and JS_ErrorFromException will return the address of that struct. Otherwise, it returns nullptr. The lifetime of the error report struct that might be returned is the same as the lifetime of the exception object.
257 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.
258 JS_EvaluateScriptForPrincipals JSAPI Reference, Obsolete, SpiderMonkey
No summary!
259 JS_ExecuteRegExp JSAPI Reference, SpiderMonkey
JS_ExecuteRegExp and JS_NewRegExpObjectNoStatics execute the RegExp object, reobj, to the specified input string, chars, from *indexp index.
260 JS_ExecuteScript JSAPI Reference, SpiderMonkey
JS_ExecuteScript executes a previously-compiled script, script.
261 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.
262 JS_ExecuteScriptVersion JSAPI Reference, Obsolete, SpiderMonkey
JS_ExecuteScript executes a previously-compiled script, script.
263 JS_FORGET_STRING_FLATNESS JSAPI Reference, Reference, Référence, SpiderMonkey
JS_FORGET_STRING_FLATNESS converts JSFlatString * to JSString *.
264 JS_FS JSAPI Reference, SpiderMonkey
Use these macros to define an array of JSFunctionSpecs to pass to JS_DefineFunctions or JS_InitClass.
265 JS_FileEscapedString JSAPI Reference, Reference, Référence, SpiderMonkey
JS_FileEscapedString writes str into file fp escaping any non-printable or non-ASCII character. If quote is not 0, it must be a single or double quote character that will quote the output.
266 JS_Finish JSAPI Reference, Obsolete, SpiderMonkey
JS_Finish is obsolete. Use JS_DestroyRuntime instead.
267 JS_FlattenString JSAPI, JSAPI Reference, Reference, Référence, SpiderMonkey
JS_FlattenString flattens a string str and returns a pointer to JSFlatString.
268 JS_FlushCaches JSAPI Reference, NeedsContent, SpiderMonkey
.
269 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.
270 JS_ForwardGetPropertyTo JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ForwardGetPropertyTo is the base implementation of JS_GetProperty, JS_GetUCProperty, JS_GetPropertyById etc, where onBehalfOf is same to obj.
271 JS_FreezeObject JSAPI Reference, Reference, Référence, SpiderMonkey
Freezes an object. This means that other code cannot delete, add or change any properties on the object. See ES5's Object.freeze method.
272 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.
273 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.
274 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.
275 JS_GetArrayPrototype JSAPI Reference, SpiderMonkey
JS_GetArrayPrototype() retrieves the original Array.prototype of a specified object, obj.  If an error occurs, it returns NULL.
276 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.
277 JS_GetClassObject JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetClassObject gets the builtin class costructor for the specified prototype key.
278 JS_GetClassPrototype JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetClassPrototype gets the builtin class costructor for the specified prototype key.
279 JS_GetCompartmentPrivate JSAPI Reference, SpiderMonkey
Please provide a description for this function.
280 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.
281 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.
282 JS_GetContextThread JSAPI Reference, SpiderMonkey
Returns the ID of the associated thread for a context.
283 JS_GetDefaultFreeOp JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetDefaultFreeOp returns default JSFreeOp for the runtime.
284 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.
285 JS_GetEmptyString JSAPI, JSAPI Reference, Reference, Référence, SpiderMonkey
The returned empty string has the length 0.
286 JS_GetEmptyStringValue JSAPI Reference, SpiderMonkey
JS_GetEmptyStringValue returns the empty string as a JS::Value.
287 JS_GetErrorPrototype JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetErrorPrototype returns the original value of Error.prototype from the global object of the current compartment of cx.
288 JS_GetExternalStringClosure JSAPI, JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
To determine if a string was created as an external string, you can call JS_IsExternalString.
289 JS_GetExternalStringFinalizer JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetExternalStringFinalizer returns the fin parameter passed to JS_NewExternalString.
290 JS_GetFlatStringChars JSAPI, JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
No summary!
291 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).
292 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.
293 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.
294 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.
295 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.
296 JS_GetFunctionObject JSAPI Reference, SpiderMonkey
JS_GetFunctionObject returns the JavaScript Function object for a specified function pointer, fun.
297 JS_GetFunctionPrototype JSAPI Reference, SpiderMonkey
JS_GetFunctionPrototype() retrieves the original Function.prototype of a specified object, obj.  If an error occurs, it returns NULL.
298 JS_GetFunctionScript JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetFunctionScript returns a pointer to JSScript for the specified function, fun. If fun is a native function, it returns NULL.
299 JS_GetGCParameter JSAPI Reference, SpiderMonkey
JS_GetGCParameter returns the current parameter of the garbage collection.
300 JS_GetGlobalForCompartmentOrNull JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetGlobalForCompartmentOrNull() returns the global object for the context and the compartment. This may return NULL if c never had a global (e.g., the atoms compartment), or if c's global has been collected.
301 JS_GetGlobalForObject JSAPI Reference, SpiderMonkey
JS_GetGlobalForObject returns the last non-null object on the parent chain of the input object.
302 JS_GetGlobalForObject3
This page was auto-generated because a user created a sub-page to this page.
303 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.
304 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.
305 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.
306 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.
307 JS_GetInternedStringChars JSAPI Reference, Obsolete, SpiderMonkey
JS_GetInternedStringChars returns a pointer to the interned string.
308 JS_GetLatin1FlatStringChars JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetLatin1FlatStringChars and JS_GetTwoByteFlatStringChars return a pointer to the string.
309 JS_GetLatin1InternedStringChars JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetLatin1InternedStringChars and JS_GetTwoByteInternedStringChars gets the characters of the string, str.
310 JS_GetLatin1StringCharsAndLength JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetLatin1StringCharsAndLength and JS_GetTwoByteStringCharsAndLength get the characters and the length of the string, str.
311 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.
312 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).
313 JS_GetObjectPrototype JSAPI Reference, SpiderMonkey
JS_GetObjectPrototype() retrieves the original Object.prototype of a specified object, obj.  If an error occurs, it returns NULL.
314 JS_GetObjectRuntime JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetObjectRuntime retrieves a pointer to the JSRuntime for a specified JSObject.
315 JS_GetOptions JSAPI Reference, Obsolete, SpiderMonkey
JS_GetOptions retrieves the option flags of a given JS context cx.
316 JS_GetOwnPropertyDescriptor JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetOwnPropertyDescriptor and JS_GetOwnPropertyDescriptorById get a detailed description of that property (returned in desc->obj). If desc->obj is null, then this property was not found on the prototype chain.
317 JS_GetParent JSAPI Reference, Obsolete, SpiderMonkey
JS_GetParent retrieves the parent object of obj, or NULL if obj does not have a parent.
318 JS_GetParentRuntime JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetParentRuntime retrieves a pointer to the parent JSRuntime of the runtime for a specified JSContext. If the cx's runtime has no parent runtime, JS_GetParentRuntime returns cx's runtime itself.
319 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.
320 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.
321 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.
322 JS_GetProperty JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetProperty examines a specified JS object obj and its prototype chain for a property with the specified name. It behaves like the JavaScript expression obj[name]. JS_GetUCProperty is the Unicode version of the function. JS_GetPropertyById is the same but takes a JS::HandleId for the property name.
323 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.
324 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.
325 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.
326 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.
327 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.
328 JS_GetRegExpFlags JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetRegExpFlags returns flags of the specified object, obj.
329 JS_GetRegExpSource JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetRegExpSource returns a source string of the specified object, obj.
330 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.
331 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.
332 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.
333 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.
334 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.
335 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.
336 JS_GetStringCharAt JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetStringCharAt and JS_GetFlatStringCharAt get the specified character from the string str.
337 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:
338 JS_GetStringCharsAndLength JSAPI Reference, Obsolete, SpiderMonkey
JS_GetStringCharsAndLength gets the characters and the length of the string, str
339 JS_GetStringEncodingLength JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetStringEncodingLength returns the length of the specified string in bytes, regardless of its encoding. You can use this value to create a buffer to encode the string into using the JS_EncodeStringToBuffer function.
340 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).
341 JS_GetTwoByteExternalStringChars JSAPI Reference, Reference, Référence, SpiderMonkey
JS_GetTwoByteExternalStringChars gets the characters of the string, str.
342 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:
343 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.
344 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.
345 JS_HasElement JSAPI Reference, Reference, Référence, SpiderMonkey
JS_HasElement examines a specified JS object, obj, and its prototype chain, for an element or numeric property numbered index.
346 JS_HasInstance JSAPI Reference, Reference, Référence, SpiderMonkey
JS_HasInstance determines if a specified JS value, v, is an instance of JS object, obj. This function is equivalent to v instanceof obj test in JavaScript. On success, JS_HasInstance stores the result of the instanceof test in *bp and returns true. On error or exception, it returns false, and the value left in *bp is undefined.
347 JS_HasOwnProperty JSAPI Reference, SpiderMonkey
Editorial review completed.
348 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.
349 JS_IdArrayGet JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IdArrayGet gets the item in the specified index of the ID array pointed to by ida.
350 JS_IdArrayLength JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IdArrayLength gets the length of the ID array pointed to by ida.
351 JS_IdToProtoKey JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IdToProtoKey converts a specified JS ID, id, to a prototype key. On success, JS_IdToProtoKey returns a JSProtoKey. Otherwise it returns JSProto_Null.
352 JS_IdToValue JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IdToValue converts a specified JS ID, id, to a JS value. On success, JS_IdToValue stores the converted value in *vp and returns true. Otherwise it returns false.
353 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.
354 JS_InitCTypesClass JSAPI, JSAPI Reference, NeedsContent, Reference, Référence, SpiderMonkey
Initialize the ctypes object on a global object. The ctypes object will be frozen.
355 JS_InitClass JSAPI Reference, SpiderMonkey
JS_InitClass initializes a JSClass and (optionally) makes it visible to JavaScript code.
356 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:
357 JS_InstanceOf JSAPI Reference, Reference, Référence, SpiderMonkey
JS_InstanceOf can be used to check whether an object obj is of a particular JSClass. To use it this way, pass NULL for argv. JS_InstanceOf returns true if obj is of the given class and false otherwise. That is, it returns JS_GetClass(obj) == clasp.
358 JS_InternJSString JSAPI Reference, Reference, Référence, SpiderMonkey
JS_InternJSString converts a string str to interned string (interned atom) and returns the result string as JSString *.
359 JS_InternString JSAPI Reference, SpiderMonkey
No summary!
360 JS_IsArrayObject JSAPI Reference, SpiderMonkey
JS_IsArrayObject determines if a specified object, obj or value, is an Array object.
361 JS_IsAssigning JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
JS_IsAssigning returns true if a script is executing and its current bytecode is a set (assignment) operation, even if there are native (no script) stack frames between the script and the caller to JS_IsAssigning.
362 JS_IsBuiltinEvalFunction JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsBuiltinEvalFunction returns whether the given function is the global eval function.
363 JS_IsBuiltinFunctionConstructor JSAPI Reference, Reference, Référence, SpiderMonkey
JS::IsCallable returns whether the given function is the global Function constructor.
364 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.
365 JS_IsConstructing_PossiblyWithGivenThisObject JSAPI, JSAPI Reference, Obsolete, Reference, Référence, SpiderMonkey
In the case of a constructor called from JS_ConstructObject and JS_InitClass where the class has the JSCLASS_CONSTRUCT_PROTOTYPE flag set, SpiderMonkey passes the constructor a non-standard this object. In such cases, the following example would provide the additional information of whether a special this was supplied.
366 JS_IsConstructor JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsConstructor determines if a specified function, fun is a valid constructor object. If so, JS_IsConstructor returns true. Otherwise it returns false.
367 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
368 JS_IsExtensible JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsExtensible queries [[Extensible]] property of the specified object, obj.
369 JS_IsExternalString JSAPI, JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsExternalString returns true if the string is an external string; otherwise it's false.
370 JS_IsGlobalObject JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsGlobalObject returns true if obj is a global object, false otherwise.
371 JS_IsIdentifier JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsIdentifier tests if the given string is a valid ECMAScript identifier. On successful, JS_IsIdentifier stores the test result to *isIdentifier and returns true, otherwise returns false and the value of *isIdentifier is undefined.
372 JS_IsNative JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsNative returns true if the object is a native object.
373 JS_IsNativeFunction JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsNativeFunction determines if a specified function object, funobj equals a specified native function, call. If so, JS_IsNativeFunction returns true. Otherwise it returns false.
374 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.
375 JS_IsStopIteration JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IsStopIteration returns true if v is StopIteration, otherwise false.
376 JS_IterateCompartments JSAPI Reference, Reference, Référence, SpiderMonkey
JS_IterateCompartments calls compartmentCallback on every compartment. Beware that there is no guarantee that the compartment will survive after the callback returns. Also, barriers are disabled via the TraceSession.
377 JS_LeaveCompartment JSAPI Reference, SpiderMonkey
No summary!
378 JS_LeaveCrossCompartmentCall JSAPI Reference, Obsolete, SpiderMonkey
No summary!
379 JS_LeaveLocalRootScope JSAPI Reference, Obsolete, SpiderMonkey
See JS_EnterLocalRootScope for an explanation of local root scopes.
380 JS_LeaveLocalRootScopeWithResult JSAPI Reference, Obsolete, SpiderMonkey
See JS_EnterLocalRootScope for an explanation of local root scopes.
381 JS_LinkConstructorAndPrototype JSAPI Reference, Reference, Référence, SpiderMonkey
JS_LinkConstructorAndPrototype sets the prototype property of class constructor function, ctor, to prototype object, proto with JSPROP_PERMANENT | JSPROP_READONLY flags, and sets the constructor property of proto to ctor with no flag.
382 JS_Lock JSAPI Reference, SpiderMonkey
Lock the JS run-time environment.
383 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.
384 JS_LookupElement JSAPI Reference, Obsolete, SpiderMonkey
JS_LookupElement examines a specified JavaScript object, obj, for a numeric property numbered index.
385 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:
386 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.
387 JS_MakeStringImmutable JSAPI Reference, Obsolete, SpiderMonkey
A string's characters can never be changed, but SpiderMonkey uses two string optimization techniques behind the scenes:
388 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.
389 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.
390 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.
391 JS_NewArrayObject JSAPI Reference, Reference, Référence, SpiderMonkey
JS_NewArrayObject with contents parameter creates a new array object with the specified contents elements. JS_NewArrayObject defines an enumerable array element with the value contents[i] on the new array.
392 JS_NewCompartmentAndGlobalObject JSAPI Reference, Obsolete, SpiderMonkey
No summary!
393 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.
394 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.
395 JS_NewDateObjectMsec Date, JSAPI, JSAPI Reference, SpiderMonkey
The returned JSObject is a standard JavaScript Date.
396 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).
397 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.
398 JS_NewDoubleValue JSAPI Reference, Obsolete, SpiderMonkey
JS_NewDoubleValue creates a floating-point jsval.
399 JS_NewExternalString JSAPI Reference, Reference, Référence, SpiderMonkey
JS_NewExternalString and JS_NewExternalStringWithClosure create a new JSString whose characters are stored in external memory, i.e., memory allocated by the application, not the JavaScript engine. Since the program allocated the memory, it will need to free it; this happens in an external string finalizer indicated by the type parameter.
400 JS_NewFunction JSAPI Reference, Reference, Référence, SpiderMonkey
JS_NewFunction creates a new JavaScript function implemented in C/C++. (To create a new function implemented in JavaScript, use JS_CompileFunction instead.)
401 JS_NewGlobalObject JSAPI, JSAPI Reference
JS_NewGlobalObject creates a new global object based on the specified class.
402 JS_NewNumberValue JSAPI Reference, Obsolete, SpiderMonkey
JS_NewNumberValue converts a C floating-point number of type jsdouble to jsval, the type of JavaScript values.
403 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. JS_NewObject attempts to assign the new object the prototype object belonging to clasp, if one is defined there. Otherwise, it creates an empty object stub for the prototype.
404 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.
405 JS_NewPlainObject JSAPI Reference, Reference, Référence, SpiderMonkey
JS_NewPlainObject creates a new plain object, like new Object(), with Object.prototype as [[Prototype]].
406 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.)
407 JS_NewRegExpObject JSAPI Reference, Reference, Référence, SpiderMonkey
JS_NewRegExpObject and JS_NewUCRegExpObject create a new RegExp instance. The flags from the built-in RegExp constructor properties ignoreCase, global, multiline, and sticky are OR'd in with the provided flags parameter.
408 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.
409 JS_NewScriptObject JSAPI Reference, Obsolete, SpiderMonkey
JS_NewScriptObject returns the script object associated with the given JSScript.
410 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.
411 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.
412 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.
413 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.
414 JS_Now JSAPI Reference, Reference, Référence, SpiderMonkey
JS_Now returns microseconds since the epoch, midnight, January 1, 1970 UTC.
415 JS_NumberValue JSAPI Reference, Reference, Référence, SpiderMonkey
JS_NumberValue converts a C floating-point number of type double to JS::Value, the type of JavaScript values.
416 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.
417 JS_ObjectIsFunction JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ObjectIsFunction tests whether obj is a function object (faster than comparing obj's class name to Function, but equivalent unless someone has overwritten the Function identifier with a different constructor and then created instances using that constructor that might be passed in as obj).
418 JS_ObjectIsRegExp JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ObjectIsRegExp determines if a specified object, obj, is a RegExp object. If so, JS_ObjectIsRegExp returns true. Otherwise it returns false.
419 JS_PSGS JSAPI Reference, Reference, Référence, SpiderMonkey
These macros encapsulate the definition of JSNative-backed JSPropertySpecs, by defining the JSNativeWrappers for them.
420 JS_ParseJSON
Parse a string using the JSON syntax described in ECMAScript 5 and return the corresponding value.
421 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).
422 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.
423 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.
424 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.
425 JS_PutEscapedString JSAPI Reference, Reference, Référence, SpiderMonkey
JS_PutEscapedString and JS_PutEscapedString write str into buffer escaping any non-printable or non-ASCII character using \escapes for JS string literals. Guarantees that a NUL is at the end of the buffer unless size is 0. Returns the length of the written output, NOT including the NUL. Thus, a return value of size or more means that the output was truncated. If buffer is null, just returns the length of the output. If quote is not 0, it must be a single or double quote character that will quote the output.
426 JS_Remove*Root JSAPI Reference, Obsolete, SpiderMonkey
JS_RemoveRoot removes the variable that rp points to from the garbage collector's root set.
427 JS_RemoveExternalStringFinalizer JSAPI Reference, Obsolete, SpiderMonkey
Remove finalizer from the global GC finalizers table, returning its type code if found, -1 if not found.
428 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.
429 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.
430 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.
431 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.
432 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.
433 JS_ResolveStandardClass JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ResolveStandardClass resolves id, which must contain either a string or an int, to a standard class name in obj if possible, defining the class's constructor and/or prototype and storing true in *resolved. If id does not name a standard class or a top-level property induced by initializing a standard class, store false in *resolved and just return true. Return false on error, as usual for bool result-typed API entry points.
434 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.
435 JS_SET_TRACING_DETAILS JSAPI Reference, SpiderMonkey
Set debugging information about the next thing to be traced by a JSTracer.
436 JS_SameValue JSAPI Reference, Reference, Référence, SpiderMonkey
SameValue slightly differs from strict equality (===) in that +0 and -0 are not the same and in that NaN is the same as NaN. The SameValue algorithm is equivalent to the following JavaScript:
437 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.
438 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.
439 JS_ScheduleGC JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ScheduleGC sets the nextScheduled parameter of GC.
440 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.
441 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.
442 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.
443 JS_SetBranchCallback JSAPI Reference, Obsolete, SpiderMonkey
If the callback returns JS_TRUE, the JS engine continues to execute the script.
444 JS_SetCallReturnValue2 JSAPI Reference, Obsolete, SpiderMonkey
Calling JS_SetCallReturnValue2 indicates to the runtime that the native will return a value of type Reference.
445 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.
446 JS_SetCompartmentNameCallback JSAPI Reference, Reference, Référence, SpiderMonkey
JS_SetCompartmentNameCallback sets callback function which will be called to name the compartment. If the runtime has no JSCompartmentNameCallback, a compartment will be named "<unknown>"</unknown>.
447 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.
448 JS_SetDefaultLocale JSAPI Reference, Reference, Référence, SpiderMonkey
JS_SetDefaultLocale sets the default locale for the ECMAScript Internationalization API (Intl.Collator, Intl.NumberFormat, Intl.DateTimeFormat).
449 JS_SetDestroyCompartmentCallback JSAPI Reference, Reference, Référence, SpiderMonkey
JS_SetDestroyCompartmentCallback sets callback function which will be called when sweeping each compartment of the runtime, before deleting the compartment.
450 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.
451 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
452 JS_SetExtraGCRoots JSAPI Reference, SpiderMonkey
Register externally maintained GC roots.
453 JS_SetFunctionCallback JSAPI Reference, Obsolete, SpiderMonkey
JS_SetFunctionCallback sets a C function to be called each time a JavaScript function is invoked or exits.
454 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.
455 JS_SetGCParametersBasedOnAvailableMemory JSAPI Reference, Reference, Référence, SpiderMonkey
JS_SetGCParametersBasedOnAvailableMemory adjusts the parameters of the garbage collection based on available memory.
456 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.
457 JS_SetGlobalObject JSAPI Reference, Obsolete, SpiderMonkey
This function is obsolete; see also JS_GetGlobalObject.
458 JS_SetICUMemoryFunctions
Sets the memory allocation and deallocation functions used by the ICU internationalization library.
459 JS_SetInterruptCallback JSAPI_Reference, Reference, Référence, SpiderMonkey
These functions allow setting an interrupt callback that will be called from the JS thread some time after any thread triggered the callback using JS_RequestInterruptCallback.
To schedule the GC and for other activities the engine internally triggers interrupt callbacks. The embedding should thus not rely on callbacks being triggered through the external API only.
460 JS_SetNativeStackQuota JSAPI Reference, Reference, Référence, SpiderMonkey
No summary!
461 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.
462 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.
463 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.
464 JS_SetParent JSAPI Reference, Obsolete, SpiderMonkey
JS_SetParent sets an object's parent.
465 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.
466 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.
467 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.
468 JS_SetProperty JSAPI Reference, Reference, Référence, SpiderMonkey
JS_SetProperty assigns the value v to the property name of the object obj. It behaves like the JavaScript expression obj[name] = v. JS_SetUCProperty is the Unicode version of the function. JS_SetPropertyById is the same but takes a JS::HandleId for the property name.
469 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.
470 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.
471 JS_SetRegExpInput JSAPI Reference, Reference, Référence, SpiderMonkey
JS_SetRegExpInput sets the pending input string of the built-in RegExp object to the specified input string. The JSREG_MULTILINE is set to multiline parameter, and other flags are all reset.
472 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.
473 JS_SetThreadStackLimit JSAPI Reference, Obsolete, SpiderMonkey
No summary!
474 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.
475 JS_SetVersionForCompartment JSAPI Reference, Reference, Référence, SpiderMonkey
JS_SetVersionForCompartment attempts to set the version of JavaScript to version for a specified compartment, compartment. The version comes from the JSVersion enumerated type.
476 JS_ShutDown JSAPI Reference, SpiderMonkey
Destroys all free-standing resources allocated by SpiderMonkey, not associated with any JSRuntime, JSContext, or other structure.
477 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.
478 JS_StringEqualsAscii JSAPI Reference, Reference, Référence, SpiderMonkey
JS_StringEqualsAscii and JS_FlatStringEqualsAscii compare string str and ASCII string asciiBytes.
479 JS_StringHasBeenInterned JSAPI Reference, Reference, Référence, SpiderMonkey
JS_StringHasBeenInterned returns true if the string str is interned.
480 JS_StringHasLatin1Chars JSAPI, JSAPI Reference, Reference, Référence, SpiderMonkey
JS_StringHasLatin1Chars returns true iff the string's characters are stored as Latin1.
481 JS_StringIsFlat JSAPI, JSAPI Reference, Reference, Référence, SpiderMonkey
JS_StringIsFlat returns true if the string is flattened.
482 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:
483 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.
484 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.
485 JS_ThrowStopIteration JSAPI Reference, SpiderMonkey
JS_ThrowStopIteration throws the appropriate StopIteration object for the function currently executing in cx.
486 JS_ToggleOptions JSAPI Reference, Obsolete, SpiderMonkey
JS_ToggleOptions toggles context-wide options. It is equivalent to JS_SetOptions(cx, JS_GetOptions(cx) ^ options).
487 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.
488 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.
489 JS_Unlock JSAPI Reference, SpiderMonkey
Unlock a previously locked JS run-time environment.
490 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.
491 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.
492 JS_ValueToFunction JSAPI Reference, SpiderMonkey
Convert a JS::Value to a JSFunction.
493 JS_ValueToId JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ValueToId converts a specified JS::Value, v, to a jsid. If v is an integer, *idp receives an integer jsid. Otherwise, if E4X support is enabled and v is an object, *idp receives an object jsid. Otherwise, *idp receives an interned string jsid based on the value of v. If v is not a string, it is converted to a string as if by calling JS_ValueToString.
494 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.
495 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.
496 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.
497 JS_ValueToSource JSAPI Reference, Reference, Référence, SpiderMonkey
JS_ValueToSource converts a specified JavaScript value, v, to a JavaScript source.
498 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.
499 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:
500 JS_YieldRequest JSAPI Reference, SpiderMonkey
Momentarily suspend the current JSAPI request, allowing garbage collection to run if another thread has requested it.
501 JS_freeop JSAPI Reference, Reference, Référence, SpiderMonkey
JS_freeop is a wrapper for js_free(p) that may delay js_free(p) invocation as a performance optimization as specified by the given JSFreeOp instance.
502 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.
503 JS_updateMallocCounter JSAPI Reference, Reference, Référence, SpiderMonkey
JS_updateMallocCounter decrements malloc counter of GC and the zone of the context.
504 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.
505 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.
506 Property attributes Attribute, JSAPI Reference, Reference, Référence, SpiderMonkey
Some property attributes are defined in the ECMAScript standard, in ECMA 262-3 §8.6.1. SpiderMonkey additionally defines several non-standard property attributes.
507 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.
508 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.
509 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.)
510 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.
511 jsid JSAPI Reference, Reference, Référence, SpiderMonkey
jsid is either a 31-bit signed integer, interned string or object.
512 jsint JSAPI Reference, Obsolete, SpiderMonkey
jsint and jsuint are 32-bit integer types.
513 JSDBGAPI JavaScript, SpiderMonkey
These functions can be used to profile a SpiderMonkey application using the Mac profiler, Shark. See Profiling JavaScript with Shark.
514 Java SpiderMonkey - MDN Build documentation, Guide, SpiderMonkey
Use these instructions to build the latest SpiderMonkey source code.
515 Parser API API, Guide, JavaScript, SpiderMonkey
Example:
516 Profiling SpiderMonkey Guide
Editorial review completed.
517 Running Automated JavaScript Tests Automated testing, Build documentation, Guide, QA, SpiderMonkey
The jstests shell harness is js/src/tests/jstests.py. Basic usage is:
518 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.
519 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.
520 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.
521 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.
522 SpiderMonkey Build Documentation Build documentation, Guide, SpiderMonkey
Use these instructions to build the latest SpiderMonkey source code.
523 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:
524 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.
525 64-bit Compatibility SpiderMonkey
The following types or typedefs are always 64-bit on 64-bit platforms, and 32-bit on 32-bit platforms:
526 Bytecode Descriptions SpiderMonkey
This document is automatically generated from Opcodes.h by make_opcode_doc.py.
527 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.
528 Functions SpiderMonkey
There are several flavors of JavaScript function. All are JSObjects of the same class, js_FunctionClass.
529 Garbage collection Guide, NeedsContent, SpiderMonkey
SpiderMonkey has a mark-sweep garbage collection (GC) with an optionally enabled incremental marking mode. The mark phase uses a mark stack, as required by incremental marking. Sweeping of objects without finalizers is deferred to a background thread.
530 Invariants SpiderMonkey
or, "The Zen of SpiderMonkey".
531 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.
532 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.
533 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.
534 Tracing JIT SpiderMonkey
The tracing JIT in SpiderMonkey consists of a generic, low level component called nanojit which is co-maintained between Adobe and Mozilla, and a SpiderMonkey-specific high level component called jstracer. The nanojit component is language agnostic, and contains no knowledge about SpiderMonkey or any other part of the Mozilla codebase. The jstracer component consists of a monitor and a recorder. The monitor watches the executing SpiderMonkey interpreter. When the monitor determines that the interpreter has entered a region of code that would benefit from native compilation, the monitor activates the recorder. The recorder records the activity of the interpreter, using nanojit to build an efficient, native representation of the execution called a fragment. The monitor then calls into the native code stored in the fragment.
535 SpiderMonkey compartments Guide, NeedsContent, NeedsExample, SpiderMonkey
No summary!
536 SpiderMonkey releases SpiderMonkey
No summary!
537 SpiderMonkey 1.8 SpiderMonkey
SpiderMonkey 1.8 has one known significant regression from 1.7.
538 SpiderMonkey 1.8.5 SpiderMonkey
SpiderMonkey 1.8.5 is supported on all the platforms where Firefox 4 runs.
539 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.
540 SpiderMonkey 1.8.8 SpiderMonkey
SpiderMonkey 1.8.8 is supported on all the platforms where Firefox INSERT-ACTUAL-FIREFOX-VERSION-NUMBER-HERE runs.
541 SpiderMonkey 17 SpiderMonkey
SpiderMonkey 17 is supported on all the platforms where Firefox 17 runs.
542 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.
543 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.
544 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.
545 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.
546 Split object JSAPI Reference, JavaScript, SpiderMonkey
In SpiderMonkey, a split object is made up of two JSObjects: an inner object and an outer object.

ドキュメントのタグと貢献者

 最終更新者: jswisher,