Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Enumerations | Functions | Variables
jsapi.h File Reference
#include <stddef.h>
#include <stdio.h>
#include "jspubtd.h"

Go to the source code of this file.

Classes

struct  JSClass
struct  JSExtendedClass
struct  JSObjectOps
struct  JSXMLObjectOps
struct  JSProperty
struct  JSIdArray
struct  JSConstDoubleSpec
struct  JSPropertySpec
struct  JSFunctionSpec
struct  JSPrincipals
struct  JSLocaleCallbacks
struct  JSErrorReport

Defines

#define JSVAL_OBJECT   0x0 /* untagged reference to object */
#define JSVAL_INT   0x1 /* tagged 31-bit integer value */
#define JSVAL_DOUBLE   0x2 /* tagged reference to double */
#define JSVAL_STRING   0x4 /* tagged reference to string */
#define JSVAL_BOOLEAN   0x6 /* tagged boolean value */
#define JSVAL_TAGBITS   3
#define JSVAL_TAGMASK   JS_BITMASK(JSVAL_TAGBITS)
#define JSVAL_TAG(v)   ((v) & JSVAL_TAGMASK)
#define JSVAL_SETTAG(v, t)   ((v) | (t))
#define JSVAL_CLRTAG(v)   ((v) & ~(jsval)JSVAL_TAGMASK)
#define JSVAL_ALIGN   JS_BIT(JSVAL_TAGBITS)
#define JSVAL_IS_OBJECT(v)   (JSVAL_TAG(v) == JSVAL_OBJECT)
#define JSVAL_IS_NUMBER(v)   (JSVAL_IS_INT(v) || JSVAL_IS_DOUBLE(v))
#define JSVAL_IS_INT(v)   (((v) & JSVAL_INT) && (v) != JSVAL_VOID)
#define JSVAL_IS_DOUBLE(v)   (JSVAL_TAG(v) == JSVAL_DOUBLE)
#define JSVAL_IS_STRING(v)   (JSVAL_TAG(v) == JSVAL_STRING)
#define JSVAL_IS_BOOLEAN(v)   (JSVAL_TAG(v) == JSVAL_BOOLEAN)
#define JSVAL_IS_NULL(v)   ((v) == JSVAL_NULL)
#define JSVAL_IS_VOID(v)   ((v) == JSVAL_VOID)
#define JSVAL_IS_PRIMITIVE(v)   (!JSVAL_IS_OBJECT(v) || JSVAL_IS_NULL(v))
#define JSVAL_IS_GCTHING(v)   (!((v) & JSVAL_INT) && !JSVAL_IS_BOOLEAN(v))
#define JSVAL_TO_GCTHING(v)   ((void *)JSVAL_CLRTAG(v))
#define JSVAL_TO_OBJECT(v)   ((JSObject *)JSVAL_TO_GCTHING(v))
#define JSVAL_TO_DOUBLE(v)   ((jsdouble *)JSVAL_TO_GCTHING(v))
#define JSVAL_TO_STRING(v)   ((JSString *)JSVAL_TO_GCTHING(v))
#define OBJECT_TO_JSVAL(obj)   ((jsval)(obj))
#define DOUBLE_TO_JSVAL(dp)   JSVAL_SETTAG((jsval)(dp), JSVAL_DOUBLE)
#define STRING_TO_JSVAL(str)   JSVAL_SETTAG((jsval)(str), JSVAL_STRING)
#define JSVAL_LOCK(cx, v)
#define JSVAL_UNLOCK(cx, v)
#define JSVAL_INT_BITS   31
#define JSVAL_INT_POW2(n)   ((jsval)1 << (n))
#define JSVAL_INT_MIN   ((jsval)1 - JSVAL_INT_POW2(30))
#define JSVAL_INT_MAX   (JSVAL_INT_POW2(30) - 1)
#define INT_FITS_IN_JSVAL(i)   ((jsuint)((i)+JSVAL_INT_MAX) <= 2*JSVAL_INT_MAX)
#define JSVAL_TO_INT(v)   ((jsint)(v) >> 1)
#define INT_TO_JSVAL(i)   (((jsval)(i) << 1) | JSVAL_INT)
#define JSVAL_TO_BOOLEAN(v)   ((JSBool)((v) >> JSVAL_TAGBITS))
#define BOOLEAN_TO_JSVAL(b)
#define JSVAL_TO_PRIVATE(v)   ((void *)((v) & ~JSVAL_INT))
#define PRIVATE_TO_JSVAL(p)   ((jsval)(p) | JSVAL_INT)
#define JSPROP_ENUMERATE   0x01 /* property is visible to for/in loop */
#define JSPROP_READONLY   0x02 /* not settable: assignment is no-op */
#define JSPROP_PERMANENT   0x04 /* property cannot be deleted */
#define JSPROP_EXPORTED   0x08 /* property is exported from object */
#define JSPROP_GETTER   0x10 /* property holds getter function */
#define JSPROP_SETTER   0x20 /* property holds setter function */
#define JSPROP_SHARED
#define JSPROP_INDEX   0x80 /* name is actually (jsint) index */
#define JSFUN_LAMBDA   0x08 /* expressed, not declared, function */
#define JSFUN_GETTER   JSPROP_GETTER
#define JSFUN_SETTER   JSPROP_SETTER
#define JSFUN_BOUND_METHOD   0x40 /* bind this to fun->object's parent */
#define JSFUN_HEAVYWEIGHT   0x80 /* activation requires a Call object */
#define JSFUN_DISJOINT_FLAGS(f)   ((f) & 0x0f)
#define JSFUN_GSFLAGS(f)   ((f) & (JSFUN_GETTER | JSFUN_SETTER))
#define JSFUN_GETTER_TEST(f)   ((f) & JSFUN_GETTER)
#define JSFUN_SETTER_TEST(f)   ((f) & JSFUN_SETTER)
#define JSFUN_BOUND_METHOD_TEST(f)   ((f) & JSFUN_BOUND_METHOD)
#define JSFUN_HEAVYWEIGHT_TEST(f)   ((f) & JSFUN_HEAVYWEIGHT)
#define JSFUN_GSFLAG2ATTR(f)   JSFUN_GSFLAGS(f)
#define JSFUN_THISP_FLAGS(f)   (f)
#define JSFUN_THISP_TEST(f, t)   ((f) & t)
#define JSFUN_THISP_STRING   0x0100 /* |this| may be a primitive string */
#define JSFUN_THISP_NUMBER   0x0200 /* |this| may be a primitive number */
#define JSFUN_THISP_BOOLEAN   0x0400 /* |this| may be a primitive boolean */
#define JSFUN_THISP_PRIMITIVE   0x0700 /* |this| may be any primitive value */
#define JSFUN_FLAGS_MASK
#define JSFUN_GENERIC_NATIVE   JSFUN_LAMBDA
#define JSVAL_VOID   INT_TO_JSVAL(0 - JSVAL_INT_POW2(30))
#define JSVAL_NULL   OBJECT_TO_JSVAL(0)
#define JSVAL_ZERO   INT_TO_JSVAL(0)
#define JSVAL_ONE   INT_TO_JSVAL(1)
#define JSVAL_FALSE   BOOLEAN_TO_JSVAL(JS_FALSE)
#define JSVAL_TRUE   BOOLEAN_TO_JSVAL(JS_TRUE)
#define JS_NewRuntime   JS_Init
#define JS_DestroyRuntime   JS_Finish
#define JS_LockRuntime   JS_Lock
#define JS_UnlockRuntime   JS_Unlock
#define JSOPTION_STRICT   JS_BIT(0) /* warn on dubious practice */
#define JSOPTION_WERROR   JS_BIT(1) /* convert warning to error */
#define JSOPTION_VAROBJFIX
#define JSOPTION_PRIVATE_IS_NSISUPPORTS
#define JSOPTION_COMPILE_N_GO
#define JSOPTION_ATLINE
#define JSOPTION_XML
#define JSOPTION_NATIVE_BRANCH_CALLBACK
#define JSOPTION_DONT_REPORT_UNCAUGHT
#define JS_MAP_GCROOT_NEXT   0 /* continue mapping entries */
#define JS_MAP_GCROOT_STOP   1 /* stop mapping entries */
#define JS_MAP_GCROOT_REMOVE   2 /* remove and free the current entry */
#define JSCLASS_HAS_PRIVATE   (1<<0) /* objects have private slot */
#define JSCLASS_NEW_ENUMERATE   (1<<1) /* has JSNewEnumerateOp hook */
#define JSCLASS_NEW_RESOLVE   (1<<2) /* has JSNewResolveOp hook */
#define JSCLASS_PRIVATE_IS_NSISUPPORTS   (1<<3) /* private is (nsISupports *) */
#define JSCLASS_SHARE_ALL_PROPERTIES   (1<<4) /* all properties are SHARED */
#define JSCLASS_NEW_RESOLVE_GETS_START
#define JSCLASS_CONSTRUCT_PROTOTYPE
#define JSCLASS_DOCUMENT_OBSERVER   (1<<7) /* DOM document observer */
#define JSCLASS_RESERVED_SLOTS_SHIFT   8 /* room for 8 flags below */
#define JSCLASS_RESERVED_SLOTS_WIDTH   8 /* and 16 above this field */
#define JSCLASS_RESERVED_SLOTS_MASK   JS_BITMASK(JSCLASS_RESERVED_SLOTS_WIDTH)
#define JSCLASS_HAS_RESERVED_SLOTS(n)
#define JSCLASS_RESERVED_SLOTS(clasp)
#define JSCLASS_HIGH_FLAGS_SHIFT
#define JSCLASS_IS_EXTENDED   (1<<(JSCLASS_HIGH_FLAGS_SHIFT+0))
#define JSCLASS_IS_ANONYMOUS   (1<<(JSCLASS_HIGH_FLAGS_SHIFT+1))
#define JSCLASS_IS_GLOBAL   (1<<(JSCLASS_HIGH_FLAGS_SHIFT+2))
#define JSCLASS_GLOBAL_FLAGS   (JSCLASS_IS_GLOBAL | JSCLASS_HAS_RESERVED_SLOTS(JSProto_LIMIT))
#define JSCLASS_CACHED_PROTO_SHIFT   (JSCLASS_HIGH_FLAGS_SHIFT + 8)
#define JSCLASS_CACHED_PROTO_WIDTH   8
#define JSCLASS_CACHED_PROTO_MASK   JS_BITMASK(JSCLASS_CACHED_PROTO_WIDTH)
#define JSCLASS_HAS_CACHED_PROTO(key)   ((key) << JSCLASS_CACHED_PROTO_SHIFT)
#define JSCLASS_CACHED_PROTO_KEY(clasp)
#define JSCLASS_NO_OPTIONAL_MEMBERS   0,0,0,0,0,0,0,0
#define JSCLASS_NO_RESERVED_MEMBERS   0,0,0,0,0
#define JS_DEFAULT_XML_NAMESPACE_ID   ((jsid) JSVAL_VOID)
#define JSRESOLVE_QUALIFIED   0x01 /* resolve a qualified property id */
#define JSRESOLVE_ASSIGNING   0x02 /* resolve on the left of assignment */
#define JSRESOLVE_DETECTING   0x04 /* 'if (o.p)...' or '(o.p) ?...:...' */
#define JSRESOLVE_DECLARING   0x08 /* var, const, or function prolog op */
#define JSRESOLVE_CLASSNAME   0x10 /* class name used when constructing */
#define JS_GET_CLASS(cx, obj)   JS_GetClass(obj)
#define JSPRINCIPALS_HOLD(cx, principals)   (++(principals)->refcount)
#define JSPRINCIPALS_DROP(cx, principals)
#define JS_DONT_PRETTY_PRINT   ((uintN)0x8000)
#define JSREPORT_ERROR   0x0 /* pseudo-flag for default case */
#define JSREPORT_WARNING   0x1 /* reported via JS_ReportWarning */
#define JSREPORT_EXCEPTION   0x2 /* exception was thrown */
#define JSREPORT_STRICT   0x4 /* error or warning due to strict option */
#define JSREPORT_IS_WARNING(flags)   (((flags) & JSREPORT_WARNING) != 0)
#define JSREPORT_IS_EXCEPTION(flags)   (((flags) & JSREPORT_EXCEPTION) != 0)
#define JSREPORT_IS_STRICT(flags)   (((flags) & JSREPORT_STRICT) != 0)
#define JSREG_FOLD   0x01 /* fold uppercase to lowercase */
#define JSREG_GLOB   0x02 /* global exec, creates array of matches */
#define JSREG_MULTILINE   0x04 /* treat ^ and $ as begin and end of line */

Typedefs

typedef intN(* JS_DLL_CALLBACK )(void *rp, const char *name, void *data)
typedef enum JSGCParamKey JSGCParamKey
typedef enum JSExecPart JSExecPart

Enumerations

enum  JSGCParamKey { JSGC_MAX_BYTES = 0, JSGC_MAX_MALLOC_BYTES = 1 }
enum  JSExecPart { JSEXEC_PROLOG, JSEXEC_MAIN }

Functions

 JS_PUBLIC_API (int64) JS_Now()
 JS_PUBLIC_API (jsval) JS_GetNaNValue(JSContext *cx)
 JS_PUBLIC_API (JSBool) JS_ConvertArguments(JSContext *cx
uintN jsval const char JS_PUBLIC_API (jsval *) JS_PushArguments(JSContext *cx
uintN jsval const char void
const char 
JS_PUBLIC_API (void) JS_PopArguments(JSContext *cx
 JS_PUBLIC_API (JSFunction *) JS_ValueToFunction(JSContext *cx
 JS_PUBLIC_API (JSString *) JS_ValueToString(JSContext *cx
 JS_PUBLIC_API (JSType) JS_TypeOfValue(JSContext *cx
 JS_PUBLIC_API (const char *) JS_GetTypeName(JSContext *cx
 JS_PUBLIC_API (JSRuntime *) JS_NewRuntime(uint32 maxbytes)
 JS_GetRuntimePrivate (JSRuntime *rt)
 JS_SetRuntimePrivate (JSRuntime *rt, void *data)
 JS_PUBLIC_API (JSContextCallback) JS_SetContextCallback(JSRuntime *rt
 JS_PUBLIC_API (JSContext *) JS_NewContext(JSRuntime *rt
 JS_PUBLIC_API (void *) JS_GetContextPrivate(JSContext *cx)
 JS_PUBLIC_API (JSVersion) JS_GetVersion(JSContext *cx)
 JS_PUBLIC_API (uint32) JS_GetOptions(JSContext *cx)
 JS_PUBLIC_API (JSObject *) JS_GetGlobalObject(JSContext *cx)
 Return fp's callee function object (fp->argv[-2]) if it has one.
 JS_PUBLIC_API (JSIdArray *) JS_EnumerateResolvedStandardClasses(JSContext *cx
 JS_PUBLIC_API (char *) JS_strdup(JSContext *cx
 JS_PUBLIC_API (jsdouble *) JS_NewDouble(JSContext *cx
 JS_PUBLIC_API (JSGCCallback) JS_SetGCCallback(JSContext *cx
 JS_PUBLIC_API (JSClass *) JS_GetClass(JSObject *obj)
 JS_PUBLIC_API (JSCheckAccessOp) JS_SetCheckObjectAccessCallback(JSRuntime *rt
 JS_PUBLIC_API (JSPrincipalsTranscoder) JS_SetPrincipalsTranscoder(JSRuntime *rt
 JS_PUBLIC_API (JSObjectPrincipalsFinder) JS_SetObjectPrincipalsFinder(JSRuntime *rt
 JS_PUBLIC_API (uintN) JS_GetFunctionFlags(JSFunction *fun)
 JS_PUBLIC_API (uint16) JS_GetFunctionArity(JSFunction *fun)
 JS_PUBLIC_API (JSScript *) JS_CompileScript(JSContext *cx
 JS_PUBLIC_API (JSBranchCallback) JS_SetBranchCallback(JSContext *cx
 JS_FRIEND_API (JSBool) JS_IsAssigning(JSContext *cx)
 JS_PUBLIC_API (JSStackFrame *) JS_SaveFrameChain(JSContext *cx)
 JS_PUBLIC_API (jschar *) JS_GetStringChars(JSString *str)
 JS_PUBLIC_API (size_t) JS_GetStringLength(JSString *str)
 JS_PUBLIC_API (const jschar *) JS_UndependString(JSContext *cx
 JS_CStringsAreUTF8 ()
 JS_EncodeCharacters (JSContext *cx, const jschar *src, size_t srclen, char *dst, size_t *dstlenp)
 JS_DecodeBytes (JSContext *cx, const char *src, size_t srclen, jschar *dst, size_t *dstlenp)
 JS_PUBLIC_API (JSLocaleCallbacks *) JS_GetLocaleCallbacks(JSContext *cx)
 JS_PUBLIC_API (JSErrorReporter) JS_SetErrorReporter(JSContext *cx
 JS_PUBLIC_API (JSExceptionState *) JS_SaveExceptionState(JSContext *cx)
 JS_PUBLIC_API (JSErrorReport *) JS_ErrorFromException(JSContext *cx

Variables

uintN argc
uintN jsvalargv
uintN jsval const char * format
uintN jsval const char void ** markp
uintN jsval const char void
const char void
mark
jsval v
jsval JSType type
jsval JSType jsvalvp
jsval JSObject ** objp
jsval jsdoubledp
jsval int32ip
jsval JSBoolbp
JSContextCallback cxCallback
size_t stackChunkSize
voiddata
JSContext ** iterp
JSVersion version
uint32 options
JSObjectobj
JSObject jsval id
JSObject jsval JSBoolresolved
JSObject JSIdArrayida
JSObject JSProtoKey key
size_t nbytes
voidp
const char * s
jsdouble d
jsdouble jsvalrval
voidrp
void const char * name
voidthing
JSGCRootMapFun map
void const char voidarg
JSGCCallback cb
JSGCParamKey uint32 value
jscharchars
jschar size_t length
JSStringstr
jsuword limitAddr
jsval jsididp
JSObject JSObjectparent_proto
JSObject JSObject JSClassclasp
JSObject JSObject JSClass JSNative constructor
JSObject JSObject JSClass
JSNative uintN 
nargs
JSObject JSObject JSClass
JSNative uintN JSPropertySpec
ps
JSObject JSObject JSClass
JSNative uintN JSPropertySpec
JSFunctionSpec
fs
JSObject JSObject JSClass
JSNative uintN JSPropertySpec
JSFunctionSpec JSPropertySpec
static_ps
JSObject JSObject JSClass
JSNative uintN JSPropertySpec
JSFunctionSpec JSPropertySpec
JSFunctionSpec
static_fs
JSObject JSObjectproto
JSObject JSObjectparent
JSObject JSBool deep
JSObject const char JSClass
JSObject uintN 
attrs
JSObject JSConstDoubleSpeccds
JSObject const char jsval
JSPropertyOp 
getter
JSObject const char jsval
JSPropertyOp JSPropertyOp 
setter
JSObject const char uintNattrsp
JSObject const char uintN JSBoolfoundp
JSObject const char uintN
JSBool JSPropertyOp * 
getterp
JSObject const char uintN
JSBool JSPropertyOp
JSPropertyOp * 
setterp
JSObject const char int8 tinyid
JSObject const char const char * alias
JSObject const char uintN flags
JSObject const jschar size_t namelen
jsint jsvalvector
JSObject jsuintlengthp
JSObject jsint index
JSObjectiterobj
JSObject jsid JSAccessMode mode
JSCheckAccessOp acb
JSPrincipalsTranscoder px
JSObjectPrincipalsFinder fop
JSNative call
JSObjectfunobj
JSObject const char * bytes
JSObject const char size_t
const char * 
filename
JSObject const char size_t
const char uintN 
lineno
JSObject JSPrincipalsprincipals
JSObject const char FILEfh
JSScriptscript
JSObject const char uintN
const char ** 
argnames
JSScript const char uintN indent
JSFunctionfun
JSObject JSScript JSExecPart part
JSObject jsval fval
JSStackFramefp
const char size_t n
JSStringstr2
JSString size_t start
JSStringleft
JSString JSStringright
JSLocaleCallbackscallbacks
const char JSErrorCallback errorCallback
const char JSErrorCallback voiduserRef
const char JSErrorCallback
void const uintN 
errorNumber
JSErrorReporter er
JSStringinput
JSString JSBool multiline
JSExceptionStatestate
const char * message
const char JSErrorReportreportp

Class Documentation

struct JSObjectOps

Definition at line 1013 of file jsapi.h.

Class Members
JSNative call
JSCheckAccessIdOp checkAccess
JSFinalizeOp clear
JSNative construct
JSConvertOp defaultValue
JSDefinePropOp defineProperty
JSPropertyIdOp deleteProperty
JSObjectMapOp destroyObjectMap
JSPropertyRefOp dropProperty
JSNewEnumerateOp enumerate
JSAttributesOp getAttributes
JSPropertyIdOp getProperty
JSGetRequiredSlotOp getRequiredSlot
JSHasInstanceOp hasInstance
JSLookupPropOp lookupProperty
JSMarkOp mark
JSNewObjectMapOp newObjectMap
JSAttributesOp setAttributes
JSSetObjectSlotOp setParent
JSPropertyIdOp setProperty
JSSetObjectSlotOp setProto
JSSetRequiredSlotOp setRequiredSlot
JSObjectOp thisObject
JSXDRObjectOp xdrObject
struct JSXMLObjectOps

Definition at line 1043 of file jsapi.h.

Class Members
JSObjectOps base
JSConcatenateOp concatenate
JSEnumerateValuesOp enumerateValues
JSEqualityOp equality
JSGetMethodOp getMethod
JSSetMethodOp setMethod
struct JSProperty

Definition at line 1062 of file jsapi.h.

Class Members
jsid id
struct JSIdArray

Definition at line 1066 of file jsapi.h.

Class Members
jsint length
jsid vector
struct JSConstDoubleSpec

Definition at line 1111 of file jsapi.h.

Class Members
jsdouble dval
uint8 flags
const char * name
uint8 spare
struct JSPropertySpec

Definition at line 1123 of file jsapi.h.

Class Members
uint8 flags
JSPropertyOp getter
const char * name
JSPropertyOp setter
int8 tinyid
struct JSFunctionSpec

Definition at line 1131 of file jsapi.h.

Class Members
JSNative call
uint32 extra
uint16 flags
const char * name
uint16 nargs
struct JSLocaleCallbacks

Definition at line 1969 of file jsapi.h.

Class Members
JSLocaleCompare localeCompare
JSErrorCallback localeGetErrorMessage
JSLocaleToLowerCase localeToLowerCase
JSLocaleToUnicode localeToUnicode
JSLocaleToUpperCase localeToUpperCase
struct JSErrorReport

Definition at line 2045 of file jsapi.h.

Class Members
uintN errorNumber
const char * filename
uintN flags
const char * linebuf
uintN lineno
const jschar ** messageArgs
const char * tokenptr
const jschar * uclinebuf
const jschar * ucmessage
const jschar * uctokenptr

Define Documentation

Value:

Definition at line 108 of file jsapi.h.

Definition at line 86 of file jsapi.h.

Definition at line 102 of file jsapi.h.

#define INT_TO_JSVAL (   i)    (((jsval)(i) << 1) | JSVAL_INT)

Definition at line 104 of file jsapi.h.

Definition at line 1085 of file jsapi.h.

#define JS_DestroyRuntime   JS_Finish

Definition at line 401 of file jsapi.h.

Definition at line 1680 of file jsapi.h.

#define JS_GET_CLASS (   cx,
  obj 
)    JS_GetClass(obj)

Definition at line 1163 of file jsapi.h.

Definition at line 402 of file jsapi.h.

#define JS_MAP_GCROOT_NEXT   0 /* continue mapping entries */

Definition at line 793 of file jsapi.h.

Definition at line 795 of file jsapi.h.

#define JS_MAP_GCROOT_STOP   1 /* stop mapping entries */

Definition at line 794 of file jsapi.h.

#define JS_NewRuntime   JS_Init

Definition at line 400 of file jsapi.h.

Definition at line 403 of file jsapi.h.

Value:

Definition at line 1004 of file jsapi.h.

Definition at line 1002 of file jsapi.h.

Definition at line 1000 of file jsapi.h.

Definition at line 1001 of file jsapi.h.

Value:
(1<<6)  /* call constructor on class
                                                   prototype */

Definition at line 958 of file jsapi.h.

#define JSCLASS_DOCUMENT_OBSERVER   (1<<7) /* DOM document observer */

Definition at line 959 of file jsapi.h.

Definition at line 996 of file jsapi.h.

Definition at line 1003 of file jsapi.h.

#define JSCLASS_HAS_PRIVATE   (1<<0) /* objects have private slot */

Definition at line 952 of file jsapi.h.

Value:

Definition at line 969 of file jsapi.h.

Value:
(JSCLASS_RESERVED_SLOTS_SHIFT +       \
                                         JSCLASS_RESERVED_SLOTS_WIDTH)

Definition at line 975 of file jsapi.h.

Definition at line 980 of file jsapi.h.

Definition at line 979 of file jsapi.h.

Definition at line 981 of file jsapi.h.

#define JSCLASS_NEW_ENUMERATE   (1<<1) /* has JSNewEnumerateOp hook */

Definition at line 953 of file jsapi.h.

#define JSCLASS_NEW_RESOLVE   (1<<2) /* has JSNewResolveOp hook */

Definition at line 954 of file jsapi.h.

Value:
(1<<5)  /* JSNewResolveOp gets starting
                                                   object in prototype chain
                                                   passed in via *objp in/out
                                                   parameter */

Definition at line 957 of file jsapi.h.

#define JSCLASS_NO_OPTIONAL_MEMBERS   0,0,0,0,0,0,0,0

Definition at line 1009 of file jsapi.h.

Definition at line 1010 of file jsapi.h.

#define JSCLASS_PRIVATE_IS_NSISUPPORTS   (1<<3) /* private is (nsISupports *) */

Definition at line 955 of file jsapi.h.

Value:

Definition at line 971 of file jsapi.h.

Definition at line 968 of file jsapi.h.

#define JSCLASS_RESERVED_SLOTS_SHIFT   8 /* room for 8 flags below */

Definition at line 966 of file jsapi.h.

#define JSCLASS_RESERVED_SLOTS_WIDTH   8 /* and 16 above this field */

Definition at line 967 of file jsapi.h.

#define JSCLASS_SHARE_ALL_PROPERTIES   (1<<4) /* all properties are SHARED */

Definition at line 956 of file jsapi.h.

#define JSFUN_BOUND_METHOD   0x40 /* bind this to fun->object's parent */

Definition at line 129 of file jsapi.h.

Definition at line 165 of file jsapi.h.

#define JSFUN_DISJOINT_FLAGS (   f)    ((f) & 0x0f)

Definition at line 132 of file jsapi.h.

Value:
0x07f8    /* overlay JSFUN_* attributes --
                                           note that bit #15 is used internally
                                           to flag interpreted functions */

Definition at line 178 of file jsapi.h.

Definition at line 193 of file jsapi.h.

Definition at line 127 of file jsapi.h.

#define JSFUN_GETTER_TEST (   f)    ((f) & JSFUN_GETTER)

Definition at line 163 of file jsapi.h.

Definition at line 168 of file jsapi.h.

#define JSFUN_GSFLAGS (   f)    ((f) & (JSFUN_GETTER | JSFUN_SETTER))

Definition at line 133 of file jsapi.h.

#define JSFUN_HEAVYWEIGHT   0x80 /* activation requires a Call object */

Definition at line 130 of file jsapi.h.

Definition at line 166 of file jsapi.h.

#define JSFUN_LAMBDA   0x08 /* expressed, not declared, function */

Definition at line 126 of file jsapi.h.

Definition at line 128 of file jsapi.h.

#define JSFUN_SETTER_TEST (   f)    ((f) & JSFUN_SETTER)

Definition at line 164 of file jsapi.h.

#define JSFUN_THISP_BOOLEAN   0x0400 /* |this| may be a primitive boolean */

Definition at line 175 of file jsapi.h.

#define JSFUN_THISP_FLAGS (   f)    (f)

Definition at line 170 of file jsapi.h.

#define JSFUN_THISP_NUMBER   0x0200 /* |this| may be a primitive number */

Definition at line 174 of file jsapi.h.

#define JSFUN_THISP_PRIMITIVE   0x0700 /* |this| may be any primitive value */

Definition at line 176 of file jsapi.h.

#define JSFUN_THISP_STRING   0x0100 /* |this| may be a primitive string */

Definition at line 173 of file jsapi.h.

#define JSFUN_THISP_TEST (   f,
  t 
)    ((f) & t)

Definition at line 171 of file jsapi.h.

Value:
JS_BIT(5)       /* //@line number ["filename"]
                                                   option supported for the
                                                   XUL preprocessor and kindred
                                                   beasts. */

Definition at line 531 of file jsapi.h.

Value:
JS_BIT(4)       /* caller of JS_Compile*Script
                                                   promises to execute compiled
                                                   script once only; enables
                                                   compile-time scope chain
                                                   resolution of consts. */

Definition at line 530 of file jsapi.h.

Value:
JS_BIT(8)       /* When returning from the
                                                   outermost API call, prevent
                                                   uncaught exceptions from
                                                   being converted to error
                                                   reports */

Definition at line 535 of file jsapi.h.

Value:
JS_BIT(7)       /* the branch callback set by
                                                   JS_SetBranchCallback may be
                                                   called with a null script
                                                   parameter, by native code
                                                   that loops intensively */

Definition at line 533 of file jsapi.h.

Value:
JS_BIT(3)       /* context private data points
                                                   to an nsISupports subclass */

Definition at line 528 of file jsapi.h.

#define JSOPTION_STRICT   JS_BIT(0) /* warn on dubious practice */

Definition at line 525 of file jsapi.h.

Value:
JS_BIT(2)       /* make JS_EvaluateScript use
                                                   the last object on its 'obj'
                                                   param's scope chain as the
                                                   ECMA 'variables object' */

Definition at line 527 of file jsapi.h.

#define JSOPTION_WERROR   JS_BIT(1) /* convert warning to error */

Definition at line 526 of file jsapi.h.

Value:
JS_BIT(6)       /* EMCAScript for XML support:
                                                   parse <!-- --> as a token,
                                                   not backward compatible with
                                                   the comment-hiding hack used
                                                   in HTML script tags. */

Definition at line 532 of file jsapi.h.

Value:
((--(principals)->refcount == 0)                                          \
     ? ((*(principals)->destroy)((cx), (principals)), 0)                      \
     : (principals)->refcount)

Definition at line 1485 of file jsapi.h.

Definition at line 1484 of file jsapi.h.

#define JSPROP_ENUMERATE   0x01 /* property is visible to for/in loop */

Definition at line 116 of file jsapi.h.

#define JSPROP_EXPORTED   0x08 /* property is exported from object */

Definition at line 119 of file jsapi.h.

#define JSPROP_GETTER   0x10 /* property holds getter function */

Definition at line 120 of file jsapi.h.

#define JSPROP_INDEX   0x80 /* name is actually (jsint) index */

Definition at line 123 of file jsapi.h.

#define JSPROP_PERMANENT   0x04 /* property cannot be deleted */

Definition at line 118 of file jsapi.h.

#define JSPROP_READONLY   0x02 /* not settable: assignment is no-op */

Definition at line 117 of file jsapi.h.

#define JSPROP_SETTER   0x20 /* property holds setter function */

Definition at line 121 of file jsapi.h.

Value:
0x40    /* don't allocate a value slot for this
                                           property; don't copy the property on
                                           set of the same-named property in an
                                           object that delegates to a prototype
                                           containing this property */

Definition at line 122 of file jsapi.h.

#define JSREG_FOLD   0x01 /* fold uppercase to lowercase */

Definition at line 2085 of file jsapi.h.

#define JSREG_GLOB   0x02 /* global exec, creates array of matches */

Definition at line 2086 of file jsapi.h.

#define JSREG_MULTILINE   0x04 /* treat ^ and $ as begin and end of line */

Definition at line 2087 of file jsapi.h.

#define JSREPORT_ERROR   0x0 /* pseudo-flag for default case */

Definition at line 2061 of file jsapi.h.

#define JSREPORT_EXCEPTION   0x2 /* exception was thrown */

Definition at line 2063 of file jsapi.h.

Definition at line 2074 of file jsapi.h.

Definition at line 2075 of file jsapi.h.

Definition at line 2073 of file jsapi.h.

#define JSREPORT_STRICT   0x4 /* error or warning due to strict option */

Definition at line 2064 of file jsapi.h.

#define JSREPORT_WARNING   0x1 /* reported via JS_ReportWarning */

Definition at line 2062 of file jsapi.h.

#define JSRESOLVE_ASSIGNING   0x02 /* resolve on the left of assignment */

Definition at line 1091 of file jsapi.h.

#define JSRESOLVE_CLASSNAME   0x10 /* class name used when constructing */

Definition at line 1094 of file jsapi.h.

#define JSRESOLVE_DECLARING   0x08 /* var, const, or function prolog op */

Definition at line 1093 of file jsapi.h.

#define JSRESOLVE_DETECTING   0x04 /* 'if (o.p)...' or '(o.p) ?...:...' */

Definition at line 1092 of file jsapi.h.

#define JSRESOLVE_QUALIFIED   0x01 /* resolve a qualified property id */

Definition at line 1090 of file jsapi.h.

Definition at line 66 of file jsapi.h.

#define JSVAL_BOOLEAN   0x6 /* tagged boolean value */

Definition at line 58 of file jsapi.h.

#define JSVAL_CLRTAG (   v)    ((v) & ~(jsval)JSVAL_TAGMASK)

Definition at line 65 of file jsapi.h.

#define JSVAL_DOUBLE   0x2 /* tagged reference to double */

Definition at line 56 of file jsapi.h.

Definition at line 203 of file jsapi.h.

#define JSVAL_INT   0x1 /* tagged 31-bit integer value */

Definition at line 55 of file jsapi.h.

Definition at line 98 of file jsapi.h.

Definition at line 101 of file jsapi.h.

Definition at line 100 of file jsapi.h.

#define JSVAL_INT_POW2 (   n)    ((jsval)1 << (n))

Definition at line 99 of file jsapi.h.

Definition at line 74 of file jsapi.h.

Definition at line 72 of file jsapi.h.

#define JSVAL_IS_GCTHING (   v)    (!((v) & JSVAL_INT) && !JSVAL_IS_BOOLEAN(v))

Definition at line 80 of file jsapi.h.

#define JSVAL_IS_INT (   v)    (((v) & JSVAL_INT) && (v) != JSVAL_VOID)

Definition at line 71 of file jsapi.h.

#define JSVAL_IS_NULL (   v)    ((v) == JSVAL_NULL)

Definition at line 75 of file jsapi.h.

Definition at line 70 of file jsapi.h.

Definition at line 69 of file jsapi.h.

Definition at line 77 of file jsapi.h.

Definition at line 73 of file jsapi.h.

#define JSVAL_IS_VOID (   v)    ((v) == JSVAL_VOID)

Definition at line 76 of file jsapi.h.

#define JSVAL_LOCK (   cx,
  v 
)
Value:

Definition at line 90 of file jsapi.h.

Definition at line 200 of file jsapi.h.

#define JSVAL_OBJECT   0x0 /* untagged reference to object */

Definition at line 54 of file jsapi.h.

Definition at line 202 of file jsapi.h.

#define JSVAL_SETTAG (   v,
  t 
)    ((v) | (t))

Definition at line 64 of file jsapi.h.

#define JSVAL_STRING   0x4 /* tagged reference to string */

Definition at line 57 of file jsapi.h.

#define JSVAL_TAG (   v)    ((v) & JSVAL_TAGMASK)

Definition at line 63 of file jsapi.h.

Definition at line 61 of file jsapi.h.

Definition at line 62 of file jsapi.h.

#define JSVAL_TO_BOOLEAN (   v)    ((JSBool)((v) >> JSVAL_TAGBITS))

Definition at line 107 of file jsapi.h.

Definition at line 83 of file jsapi.h.

Definition at line 81 of file jsapi.h.

#define JSVAL_TO_INT (   v)    ((jsint)(v) >> 1)

Definition at line 103 of file jsapi.h.

Definition at line 82 of file jsapi.h.

#define JSVAL_TO_PRIVATE (   v)    ((void *)((v) & ~JSVAL_INT))

Definition at line 112 of file jsapi.h.

Definition at line 84 of file jsapi.h.

Definition at line 204 of file jsapi.h.

#define JSVAL_UNLOCK (   cx,
  v 
)
Value:

Definition at line 93 of file jsapi.h.

Definition at line 199 of file jsapi.h.

Definition at line 201 of file jsapi.h.

#define OBJECT_TO_JSVAL (   obj)    ((jsval)(obj))

Definition at line 85 of file jsapi.h.

#define PRIVATE_TO_JSVAL (   p)    ((jsval)(p) | JSVAL_INT)

Definition at line 113 of file jsapi.h.

Definition at line 87 of file jsapi.h.


Typedef Documentation

typedef intN(* JS_DLL_CALLBACK)(void *rp, const char *name, void *data)

Definition at line 798 of file jsapi.h.

typedef enum JSExecPart JSExecPart
typedef enum JSGCParamKey JSGCParamKey

Enumeration Type Documentation

enum JSExecPart
Enumerator:
JSEXEC_PROLOG 
JSEXEC_MAIN 

Definition at line 1730 of file jsapi.h.

: unless you already depend on this buggy variables object
Enumerator:
JSGC_MAX_BYTES 
JSGC_MAX_MALLOC_BYTES 

Definition at line 846 of file jsapi.h.

                          {

Function Documentation

Definition at line 4662 of file jsapi.c.

{
#ifdef JS_C_STRINGS_ARE_UTF8
    return JS_TRUE;
#else
    return JS_FALSE;
#endif
}

Here is the caller graph for this function:

JS_DecodeBytes ( JSContext cx,
const char *  src,
size_t  srclen,
jschar dst,
size_t *  dstlenp 
)

Definition at line 4655 of file jsapi.c.

{
    return js_InflateStringToBuffer(cx, src, srclen, dst, dstlenp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_EncodeCharacters ( JSContext cx,
const jschar src,
size_t  srclen,
char *  dst,
size_t *  dstlenp 
)

Definition at line 4648 of file jsapi.c.

{
    return js_DeflateStringToBuffer(cx, src, srclen, dst, dstlenp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 796 of file jsapi.c.

{
    return rt->data;
}

Definition at line 56 of file jslong.c.

{ return ll_maxint; }

Definition at line 58 of file jslog2.c.

{
    JSIntn log2;

    JS_FLOOR_LOG2(log2, n);
    return log2;
}
JS_PUBLIC_API ( const char *  )
JS_PUBLIC_API ( JSContextCallback  )

Return fp's callee function object (fp->argv[-2]) if it has one.

JS_PUBLIC_API ( char *  )

Definition at line 1147 of file jsprf.c.

{
    SprintfState ss;
    int rv;

    ss.stuff = GrowStuff;
    ss.base = 0;
    ss.cur = 0;
    ss.maxlen = 0;
    rv = dosprintf(&ss, fmt, ap);
    if (rv < 0) {
        if (ss.base) {
            free(ss.base);
        }
        return 0;
    }
    return ss.base;
}

Here is the call graph for this function:

JS_PUBLIC_API ( JSGCCallback  )
JS_PUBLIC_API ( JSCheckAccessOp  )
JS_PUBLIC_API ( JSPrincipalsTranscoder  )
JS_PUBLIC_API ( JSObjectPrincipalsFinder  )
JS_PUBLIC_API ( JSBranchCallback  )
JS_PUBLIC_API ( size_t  )
JS_PUBLIC_API ( JSErrorReporter  )
JS_SetRuntimePrivate ( JSRuntime rt,
void data 
)

Definition at line 802 of file jsapi.c.

{
    rt->data = data;
}

Variable Documentation

JSCheckAccessOp acb

Definition at line 1446 of file jsapi.h.

Definition at line 1272 of file jsapi.h.

void const char void* arg

Definition at line 829 of file jsapi.h.

Definition at line 260 of file jsapi.h.

Definition at line 1647 of file jsapi.h.

char *const * argv

Definition at line 260 of file jsapi.h.

JSObject const jschar size_t JSNative uintN uintN attrs

Definition at line 1220 of file jsapi.h.

Definition at line 1240 of file jsapi.h.

Definition at line 387 of file jsapi.h.

char* bytes

Definition at line 1573 of file jsapi.h.

JSObject const jschar size_t JSNative call

Definition at line 1503 of file jsapi.h.

Definition at line 1982 of file jsapi.h.

JSBranchCallback cb

Definition at line 838 of file jsapi.h.

Definition at line 1224 of file jsapi.h.

Definition at line 891 of file jsapi.h.

Definition at line 1149 of file jsapi.h.

Definition at line 1149 of file jsapi.h.

JSContextCallback cxCallback

Definition at line 480 of file jsapi.h.

Definition at line 615 of file jsapi.h.

Definition at line 498 of file jsapi.h.

Definition at line 1209 of file jsapi.h.

Definition at line 356 of file jsapi.h.

JSErrorReporter er

Definition at line 2078 of file jsapi.h.

const char JSErrorCallback void const uintN JSErrorCallback void const uintN const char uintN JSErrorCallback void const uintN uintN JSErrorCallback errorCallback

Definition at line 2010 of file jsapi.h.

const char JSErrorCallback void const uintN JSErrorCallback void const uintN const char uintN JSErrorCallback void const uintN uintN JSErrorCallback void const uintN errorNumber

Definition at line 2010 of file jsapi.h.

Definition at line 1609 of file jsapi.h.

Definition at line 1584 of file jsapi.h.

jschar size_t uintN flags

Definition at line 1282 of file jsapi.h.

JSObjectPrincipalsFinder fop

Definition at line 1495 of file jsapi.h.

const char JSErrorCallback void const uintN JSErrorCallback void const uintN const char* format

Definition at line 260 of file jsapi.h.

Definition at line 1240 of file jsapi.h.

Definition at line 1819 of file jsapi.h.

Definition at line 1149 of file jsapi.h.

Definition at line 1683 of file jsapi.h.

Definition at line 1563 of file jsapi.h.

Definition at line 1771 of file jsapi.h.

JSObject jsint jsval JSPropertyOp getter

Definition at line 1230 of file jsapi.h.

JSObject const jschar size_t uintN JSBool JSPropertyOp * getterp

Definition at line 1249 of file jsapi.h.

Definition at line 580 of file jsapi.h.

Definition at line 592 of file jsapi.h.

Definition at line 1075 of file jsapi.h.

Definition at line 1673 of file jsapi.h.

Definition at line 1395 of file jsapi.h.

Definition at line 2096 of file jsapi.h.

Definition at line 363 of file jsapi.h.

Definition at line 1439 of file jsapi.h.

Definition at line 504 of file jsapi.h.

Definition at line 596 of file jsapi.h.

Definition at line 1910 of file jsapi.h.

jschar size_t length

Definition at line 891 of file jsapi.h.

Definition at line 1386 of file jsapi.h.

Definition at line 906 of file jsapi.h.

Definition at line 1584 of file jsapi.h.

JSGCRootMapFun map

Definition at line 801 of file jsapi.h.

Definition at line 288 of file jsapi.h.

Definition at line 280 of file jsapi.h.

const char* message

Definition at line 2158 of file jsapi.h.

PRIntn mode

Definition at line 1442 of file jsapi.h.

Definition at line 2096 of file jsapi.h.

const jschar size_t n

Definition at line 1836 of file jsapi.h.

Definition at line 649 of file jsapi.h.

Definition at line 1307 of file jsapi.h.

Definition at line 1149 of file jsapi.h.

void size_t nbytes

Definition at line 603 of file jsapi.h.

Definition at line 554 of file jsapi.h.

Definition at line 344 of file jsapi.h.

Definition at line 542 of file jsapi.h.

void * p

Definition at line 606 of file jsapi.h.

Definition at line 1192 of file jsapi.h.

Definition at line 1149 of file jsapi.h.

Definition at line 1733 of file jsapi.h.

Definition at line 1589 of file jsapi.h.

Definition at line 1186 of file jsapi.h.

Definition at line 1149 of file jsapi.h.

JSPrincipalsTranscoder px

Definition at line 1492 of file jsapi.h.

Definition at line 2158 of file jsapi.h.

Definition at line 580 of file jsapi.h.

Definition at line 1910 of file jsapi.h.

void* rp

Definition at line 640 of file jsapi.h.

Definition at line 618 of file jsapi.h.

Definition at line 612 of file jsapi.h.

Definition at line 1634 of file jsapi.h.

JSObject jsint jsval JSPropertyOp JSPropertyOp setter

Definition at line 1230 of file jsapi.h.

JSObject const jschar size_t uintN JSBool JSPropertyOp JSPropertyOp * setterp

Definition at line 1249 of file jsapi.h.

Definition at line 483 of file jsapi.h.

char void(* start)(void)

Definition at line 1899 of file jsapi.h.

Definition at line 2138 of file jsapi.h.

Definition at line 1149 of file jsapi.h.

Definition at line 1149 of file jsapi.h.

Definition at line 898 of file jsapi.h.

Definition at line 1869 of file jsapi.h.

Definition at line 737 of file jsapi.h.

Definition at line 1266 of file jsapi.h.

Definition at line 341 of file jsapi.h.

const char JSErrorCallback void const uintN JSErrorCallback void const uintN const char uintN JSErrorCallback void const uintN uintN JSErrorCallback void * userRef

Definition at line 2010 of file jsapi.h.

Definition at line 341 of file jsapi.h.

Definition at line 852 of file jsapi.h.

Definition at line 1380 of file jsapi.h.

Definition at line 510 of file jsapi.h.

jsval * vp

Definition at line 341 of file jsapi.h.