Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions | Variables
jsapi.c File Reference
#include "jsstddef.h"
#include <ctype.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "jstypes.h"
#include "jsarena.h"
#include "jsutil.h"
#include "jsclist.h"
#include "jsdhash.h"
#include "jsprf.h"
#include "jsapi.h"
#include "jsarray.h"
#include "jsatom.h"
#include "jsbool.h"
#include "jscntxt.h"
#include "jsconfig.h"
#include "jsdate.h"
#include "jsdtoa.h"
#include "jsemit.h"
#include "jsexn.h"
#include "jsfun.h"
#include "jsgc.h"
#include "jsinterp.h"
#include "jslock.h"
#include "jsmath.h"
#include "jsnum.h"
#include "jsobj.h"
#include "jsopcode.h"
#include "jsparse.h"
#include "jsregexp.h"
#include "jsscan.h"
#include "jsscope.h"
#include "jsscript.h"
#include "jsstr.h"
#include "prmjtime.h"
#include "jsxml.h"
#include "jsiter.h"

Go to the source code of this file.

Classes

struct  v2smap
struct  JSStdName
struct  JSExceptionState

Defines

#define JS_ADDRESSOF_VA_LIST(ap)   (&(ap))
#define CHECK_REQUEST(cx)   ((void)0)
#define SYNC_OPTIONS_TO_VERSION(cx)
#define ATOM_OFFSET(name)   offsetof(JSAtomState,name##Atom)
#define CLASS_ATOM_OFFSET(name)   offsetof(JSAtomState,classAtoms[JSProto_##name])
#define OFFSET_TO_ATOM(rt, off)   (*(JSAtom **)((char*)&(rt)->atomState + (off)))
#define CLASP(name)   (JSClass *)&js_##name##Class
#define EAGER_ATOM(name)   ATOM_OFFSET(name), NULL
#define EAGER_CLASS_ATOM(name)   CLASS_ATOM_OFFSET(name), NULL
#define EAGER_ATOM_AND_CLASP(name)   EAGER_CLASS_ATOM(name), CLASP(name)
#define LAZY_ATOM(name)   ATOM_OFFSET(lazy.name), js_##name##_str
#define AUTO_NAMELEN(s, n)   (((n) == (size_t)-1) ? js_strlen(s) : (n))
#define JSSLOT_ITER_INDEX   (JSSLOT_PRIVATE + 1)
#define LAST_FRAME_EXCEPTION_CHECK(cx, result)
#define LAST_FRAME_CHECKS(cx, result)

Typedefs

typedef struct JSStdName JSStdName

Functions

 JS_Now ()
 JS_GetNaNValue (JSContext *cx)
 JS_GetNegativeInfinityValue (JSContext *cx)
 JS_GetPositiveInfinityValue (JSContext *cx)
 JS_GetEmptyStringValue (JSContext *cx)
static JSBool TryArgumentFormatter (JSContext *cx, const char **formatp, JSBool fromJS, jsval **vpp, va_list *app)
 JS_ConvertArguments (JSContext *cx, uintN argc, jsval *argv, const char *format,...)
 JS_ConvertArgumentsVA (JSContext *cx, uintN argc, jsval *argv, const char *format, va_list ap)
 JS_PushArguments (JSContext *cx, void **markp, const char *format,...)
 JS_PushArgumentsVA (JSContext *cx, void **markp, const char *format, va_list ap)
 JS_PopArguments (JSContext *cx, void *mark)
 JS_AddArgumentFormatter (JSContext *cx, const char *format, JSArgumentFormatter formatter)
 JS_RemoveArgumentFormatter (JSContext *cx, const char *format)
 JS_ConvertValue (JSContext *cx, jsval v, JSType type, jsval *vp)
 JS_ValueToObject (JSContext *cx, jsval v, JSObject **objp)
 JS_ValueToFunction (JSContext *cx, jsval v)
 JS_ValueToConstructor (JSContext *cx, jsval v)
 JS_ValueToString (JSContext *cx, jsval v)
 JS_ValueToNumber (JSContext *cx, jsval v, jsdouble *dp)
 JS_ValueToECMAInt32 (JSContext *cx, jsval v, int32 *ip)
 JS_ValueToECMAUint32 (JSContext *cx, jsval v, uint32 *ip)
 JS_ValueToInt32 (JSContext *cx, jsval v, int32 *ip)
 JS_ValueToUint16 (JSContext *cx, jsval v, uint16 *ip)
 JS_ValueToBoolean (JSContext *cx, jsval v, JSBool *bp)
 JS_TypeOfValue (JSContext *cx, jsval v)
 JS_GetTypeName (JSContext *cx, JSType type)
 JS_NewRuntime (uint32 maxbytes)
 JS_DestroyRuntime (JSRuntime *rt)
 JS_ShutDown (void)
 JS_GetRuntimePrivate (JSRuntime *rt)
 JS_SetRuntimePrivate (JSRuntime *rt, void *data)
 JS_Lock (JSRuntime *rt)
 JS_Unlock (JSRuntime *rt)
 JS_SetContextCallback (JSRuntime *rt, JSContextCallback cxCallback)
 JS_NewContext (JSRuntime *rt, size_t stackChunkSize)
 JS_DestroyContext (JSContext *cx)
 JS_DestroyContextNoGC (JSContext *cx)
 JS_DestroyContextMaybeGC (JSContext *cx)
 JS_GetContextPrivate (JSContext *cx)
 JS_SetContextPrivate (JSContext *cx, void *data)
 JS_GetRuntime (JSContext *cx)
 JS_ContextIterator (JSRuntime *rt, JSContext **iterp)
 JS_GetVersion (JSContext *cx)
 JS_SetVersion (JSContext *cx, JSVersion version)
 JS_VersionToString (JSVersion version)
 JS_StringToVersion (const char *string)
 JS_GetOptions (JSContext *cx)
 JS_SetOptions (JSContext *cx, uint32 options)
 JS_ToggleOptions (JSContext *cx, uint32 options)
 JS_GetImplementationVersion (void)
 JS_GetGlobalObject (JSContext *cx)
 JS_SetGlobalObject (JSContext *cx, JSObject *obj)
JSObjectjs_InitFunctionAndObjectClasses (JSContext *cx, JSObject *obj)
 JS_InitStandardClasses (JSContext *cx, JSObject *obj)
static JSAtomStdNameToAtom (JSContext *cx, JSStdName *stdn)
 JS_ResolveStandardClass (JSContext *cx, JSObject *obj, jsval id, JSBool *resolved)
static JSBool AlreadyHasOwnProperty (JSContext *cx, JSObject *obj, JSAtom *atom)
 JS_EnumerateStandardClasses (JSContext *cx, JSObject *obj)
static JSIdArrayAddAtomToArray (JSContext *cx, JSAtom *atom, JSIdArray *ida, jsint *ip)
static JSIdArrayEnumerateIfResolved (JSContext *cx, JSObject *obj, JSAtom *atom, JSIdArray *ida, jsint *ip, JSBool *foundp)
 JS_EnumerateResolvedStandardClasses (JSContext *cx, JSObject *obj, JSIdArray *ida)
 JS_GetClassObject (JSContext *cx, JSObject *obj, JSProtoKey key, JSObject **objp)
 JS_GetScopeChain (JSContext *cx)
 JS_malloc (JSContext *cx, size_t nbytes)
 JS_realloc (JSContext *cx, void *p, size_t nbytes)
 JS_free (JSContext *cx, void *p)
 JS_strdup (JSContext *cx, const char *s)
 JS_NewDouble (JSContext *cx, jsdouble d)
 JS_NewDoubleValue (JSContext *cx, jsdouble d, jsval *rval)
 JS_NewNumberValue (JSContext *cx, jsdouble d, jsval *rval)
 JS_AddRoot (JSContext *cx, void *rp)
 JS_AddNamedRootRT (JSRuntime *rt, void *rp, const char *name)
 JS_RemoveRoot (JSContext *cx, void *rp)
 JS_RemoveRootRT (JSRuntime *rt, void *rp)
 JS_AddNamedRoot (JSContext *cx, void *rp, const char *name)
 JS_ClearNewbornRoots (JSContext *cx)
 JS_EnterLocalRootScope (JSContext *cx)
 JS_LeaveLocalRootScope (JSContext *cx)
 JS_LeaveLocalRootScopeWithResult (JSContext *cx, jsval rval)
 JS_ForgetLocalRoot (JSContext *cx, void *thing)
 JS_MapGCRoots (JSRuntime *rt, JSGCRootMapFun map, void *data)
 JS_LockGCThing (JSContext *cx, void *thing)
 JS_LockGCThingRT (JSRuntime *rt, void *thing)
 JS_UnlockGCThing (JSContext *cx, void *thing)
 JS_UnlockGCThingRT (JSRuntime *rt, void *thing)
 JS_MarkGCThing (JSContext *cx, void *thing, const char *name, void *arg)
 JS_GC (JSContext *cx)
 JS_MaybeGC (JSContext *cx)
 JS_SetGCCallback (JSContext *cx, JSGCCallback cb)
 JS_SetGCCallbackRT (JSRuntime *rt, JSGCCallback cb)
 JS_IsAboutToBeFinalized (JSContext *cx, void *thing)
 JS_SetGCParameter (JSRuntime *rt, JSGCParamKey key, uint32 value)
 JS_AddExternalStringFinalizer (JSStringFinalizeOp finalizer)
 JS_RemoveExternalStringFinalizer (JSStringFinalizeOp finalizer)
 JS_NewExternalString (JSContext *cx, jschar *chars, size_t length, intN type)
 JS_GetExternalStringGCType (JSRuntime *rt, JSString *str)
 JS_SetThreadStackLimit (JSContext *cx, jsuword limitAddr)
 JS_DestroyIdArray (JSContext *cx, JSIdArray *ida)
 JS_ValueToId (JSContext *cx, jsval v, jsid *idp)
 JS_IdToValue (JSContext *cx, jsid id, jsval *vp)
 JS_PropertyStub (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 JS_EnumerateStub (JSContext *cx, JSObject *obj)
 JS_ResolveStub (JSContext *cx, JSObject *obj, jsval id)
 JS_ConvertStub (JSContext *cx, JSObject *obj, JSType type, jsval *vp)
 JS_FinalizeStub (JSContext *cx, JSObject *obj)
 JS_InitClass (JSContext *cx, JSObject *obj, JSObject *parent_proto, JSClass *clasp, JSNative constructor, uintN nargs, JSPropertySpec *ps, JSFunctionSpec *fs, JSPropertySpec *static_ps, JSFunctionSpec *static_fs)
 JS_GetClass (JSObject *obj)
 JS_InstanceOf (JSContext *cx, JSObject *obj, JSClass *clasp, jsval *argv)
 JS_HasInstance (JSContext *cx, JSObject *obj, jsval v, JSBool *bp)
 JS_GetPrivate (JSContext *cx, JSObject *obj)
 JS_SetPrivate (JSContext *cx, JSObject *obj, void *data)
 JS_GetInstancePrivate (JSContext *cx, JSObject *obj, JSClass *clasp, jsval *argv)
 JS_GetPrototype (JSContext *cx, JSObject *obj)
 JS_SetPrototype (JSContext *cx, JSObject *obj, JSObject *proto)
 JS_GetParent (JSContext *cx, JSObject *obj)
 JS_SetParent (JSContext *cx, JSObject *obj, JSObject *parent)
 JS_GetConstructor (JSContext *cx, JSObject *proto)
 JS_GetObjectId (JSContext *cx, JSObject *obj, jsid *idp)
 JS_NewObject (JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent)
 JS_SealObject (JSContext *cx, JSObject *obj, JSBool deep)
 JS_ConstructObject (JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent)
 JS_ConstructObjectWithArguments (JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent, uintN argc, jsval *argv)
static JSBool DefineProperty (JSContext *cx, JSObject *obj, const char *name, jsval value, JSPropertyOp getter, JSPropertyOp setter, uintN attrs, uintN flags, intN tinyid)
static JSBool DefineUCProperty (JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, jsval value, JSPropertyOp getter, JSPropertyOp setter, uintN attrs, uintN flags, intN tinyid)
 JS_DefineObject (JSContext *cx, JSObject *obj, const char *name, JSClass *clasp, JSObject *proto, uintN attrs)
 JS_DefineConstDoubles (JSContext *cx, JSObject *obj, JSConstDoubleSpec *cds)
 JS_DefineProperties (JSContext *cx, JSObject *obj, JSPropertySpec *ps)
 JS_DefineProperty (JSContext *cx, JSObject *obj, const char *name, jsval value, JSPropertyOp getter, JSPropertyOp setter, uintN attrs)
 JS_DefinePropertyWithTinyId (JSContext *cx, JSObject *obj, const char *name, int8 tinyid, jsval value, JSPropertyOp getter, JSPropertyOp setter, uintN attrs)
static JSBool LookupProperty (JSContext *cx, JSObject *obj, const char *name, JSObject **objp, JSProperty **propp)
static JSBool LookupUCProperty (JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, JSObject **objp, JSProperty **propp)
 JS_AliasProperty (JSContext *cx, JSObject *obj, const char *name, const char *alias)
static jsval LookupResult (JSContext *cx, JSObject *obj, JSObject *obj2, JSProperty *prop)
static JSBool GetPropertyAttributes (JSContext *cx, JSObject *obj, JSAtom *atom, uintN *attrsp, JSBool *foundp, JSPropertyOp *getterp, JSPropertyOp *setterp)
static JSBool SetPropertyAttributes (JSContext *cx, JSObject *obj, JSAtom *atom, uintN attrs, JSBool *foundp)
 JS_GetPropertyAttributes (JSContext *cx, JSObject *obj, const char *name, uintN *attrsp, JSBool *foundp)
 JS_GetPropertyAttrsGetterAndSetter (JSContext *cx, JSObject *obj, const char *name, uintN *attrsp, JSBool *foundp, JSPropertyOp *getterp, JSPropertyOp *setterp)
 JS_SetPropertyAttributes (JSContext *cx, JSObject *obj, const char *name, uintN attrs, JSBool *foundp)
 JS_HasProperty (JSContext *cx, JSObject *obj, const char *name, JSBool *foundp)
 JS_LookupProperty (JSContext *cx, JSObject *obj, const char *name, jsval *vp)
 JS_LookupPropertyWithFlags (JSContext *cx, JSObject *obj, const char *name, uintN flags, jsval *vp)
 JS_GetProperty (JSContext *cx, JSObject *obj, const char *name, jsval *vp)
 JS_GetMethodById (JSContext *cx, JSObject *obj, jsid id, JSObject **objp, jsval *vp)
 JS_GetMethod (JSContext *cx, JSObject *obj, const char *name, JSObject **objp, jsval *vp)
 JS_SetProperty (JSContext *cx, JSObject *obj, const char *name, jsval *vp)
 JS_DeleteProperty (JSContext *cx, JSObject *obj, const char *name)
 JS_DeleteProperty2 (JSContext *cx, JSObject *obj, const char *name, jsval *rval)
 JS_DefineUCProperty (JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, jsval value, JSPropertyOp getter, JSPropertyOp setter, uintN attrs)
 JS_GetUCPropertyAttributes (JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, uintN *attrsp, JSBool *foundp)
 JS_GetUCPropertyAttrsGetterAndSetter (JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, uintN *attrsp, JSBool *foundp, JSPropertyOp *getterp, JSPropertyOp *setterp)
 JS_SetUCPropertyAttributes (JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, uintN attrs, JSBool *foundp)
 JS_DefineUCPropertyWithTinyId (JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, int8 tinyid, jsval value, JSPropertyOp getter, JSPropertyOp setter, uintN attrs)
 JS_HasUCProperty (JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, JSBool *vp)
 JS_LookupUCProperty (JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, jsval *vp)
 JS_GetUCProperty (JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, jsval *vp)
 JS_SetUCProperty (JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, jsval *vp)
 JS_DeleteUCProperty2 (JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, jsval *rval)
 JS_NewArrayObject (JSContext *cx, jsint length, jsval *vector)
 JS_IsArrayObject (JSContext *cx, JSObject *obj)
 JS_GetArrayLength (JSContext *cx, JSObject *obj, jsuint *lengthp)
 JS_SetArrayLength (JSContext *cx, JSObject *obj, jsuint length)
 JS_HasArrayLength (JSContext *cx, JSObject *obj, jsuint *lengthp)
 JS_DefineElement (JSContext *cx, JSObject *obj, jsint index, jsval value, JSPropertyOp getter, JSPropertyOp setter, uintN attrs)
 JS_AliasElement (JSContext *cx, JSObject *obj, const char *name, jsint alias)
 JS_HasElement (JSContext *cx, JSObject *obj, jsint index, JSBool *foundp)
 JS_LookupElement (JSContext *cx, JSObject *obj, jsint index, jsval *vp)
 JS_GetElement (JSContext *cx, JSObject *obj, jsint index, jsval *vp)
 JS_SetElement (JSContext *cx, JSObject *obj, jsint index, jsval *vp)
 JS_DeleteElement (JSContext *cx, JSObject *obj, jsint index)
 JS_DeleteElement2 (JSContext *cx, JSObject *obj, jsint index, jsval *rval)
 JS_ClearScope (JSContext *cx, JSObject *obj)
 JS_Enumerate (JSContext *cx, JSObject *obj)
static void prop_iter_finalize (JSContext *cx, JSObject *obj)
static uint32 prop_iter_mark (JSContext *cx, JSObject *obj, void *arg)
 JS_NewPropertyIterator (JSContext *cx, JSObject *obj)
 JS_NextProperty (JSContext *cx, JSObject *iterobj, jsid *idp)
 JS_CheckAccess (JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode, jsval *vp, uintN *attrsp)
 JS_SetCheckObjectAccessCallback (JSRuntime *rt, JSCheckAccessOp acb)
static JSBool ReservedSlotIndexOK (JSContext *cx, JSObject *obj, JSClass *clasp, uint32 index, uint32 limit)
 JS_GetReservedSlot (JSContext *cx, JSObject *obj, uint32 index, jsval *vp)
 JS_SetReservedSlot (JSContext *cx, JSObject *obj, uint32 index, jsval v)
 JS_SetPrincipalsTranscoder (JSRuntime *rt, JSPrincipalsTranscoder px)
 JS_SetObjectPrincipalsFinder (JSRuntime *rt, JSObjectPrincipalsFinder fop)
 JS_NewFunction (JSContext *cx, JSNative native, uintN nargs, uintN flags, JSObject *parent, const char *name)
 JS_CloneFunctionObject (JSContext *cx, JSObject *funobj, JSObject *parent)
 JS_GetFunctionObject (JSFunction *fun)
 JS_GetFunctionName (JSFunction *fun)
 JS_GetFunctionId (JSFunction *fun)
 JS_GetFunctionFlags (JSFunction *fun)
 JS_GetFunctionArity (JSFunction *fun)
 JS_ObjectIsFunction (JSContext *cx, JSObject *obj)
 js_generic_native_method_dispatcher (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 JS_DefineFunctions (JSContext *cx, JSObject *obj, JSFunctionSpec *fs)
 JS_DefineFunction (JSContext *cx, JSObject *obj, const char *name, JSNative call, uintN nargs, uintN attrs)
 JS_DefineUCFunction (JSContext *cx, JSObject *obj, const jschar *name, size_t namelen, JSNative call, uintN nargs, uintN attrs)
static JSScriptCompileTokenStream (JSContext *cx, JSObject *obj, JSTokenStream *ts, void *tempMark, JSBool *eofp)
 JS_CompileScript (JSContext *cx, JSObject *obj, const char *bytes, size_t length, const char *filename, uintN lineno)
 JS_CompileScriptForPrincipals (JSContext *cx, JSObject *obj, JSPrincipals *principals, const char *bytes, size_t length, const char *filename, uintN lineno)
 JS_CompileUCScript (JSContext *cx, JSObject *obj, const jschar *chars, size_t length, const char *filename, uintN lineno)
 JS_CompileUCScriptForPrincipals (JSContext *cx, JSObject *obj, JSPrincipals *principals, const jschar *chars, size_t length, const char *filename, uintN lineno)
 JS_BufferIsCompilableUnit (JSContext *cx, JSObject *obj, const char *bytes, size_t length)
 JS_CompileFile (JSContext *cx, JSObject *obj, const char *filename)
 JS_CompileFileHandle (JSContext *cx, JSObject *obj, const char *filename, FILE *file)
 JS_CompileFileHandleForPrincipals (JSContext *cx, JSObject *obj, const char *filename, FILE *file, JSPrincipals *principals)
 JS_NewScriptObject (JSContext *cx, JSScript *script)
 JS_GetScriptObject (JSScript *script)
 JS_DestroyScript (JSContext *cx, JSScript *script)
 JS_CompileFunction (JSContext *cx, JSObject *obj, const char *name, uintN nargs, const char **argnames, const char *bytes, size_t length, const char *filename, uintN lineno)
 JS_CompileFunctionForPrincipals (JSContext *cx, JSObject *obj, JSPrincipals *principals, const char *name, uintN nargs, const char **argnames, const char *bytes, size_t length, const char *filename, uintN lineno)
 JS_CompileUCFunction (JSContext *cx, JSObject *obj, const char *name, uintN nargs, const char **argnames, const jschar *chars, size_t length, const char *filename, uintN lineno)
 JS_CompileUCFunctionForPrincipals (JSContext *cx, JSObject *obj, JSPrincipals *principals, const char *name, uintN nargs, const char **argnames, const jschar *chars, size_t length, const char *filename, uintN lineno)
 JS_DecompileScript (JSContext *cx, JSScript *script, const char *name, uintN indent)
 JS_DecompileFunction (JSContext *cx, JSFunction *fun, uintN indent)
 JS_DecompileFunctionBody (JSContext *cx, JSFunction *fun, uintN indent)
 JS_ExecuteScript (JSContext *cx, JSObject *obj, JSScript *script, jsval *rval)
 JS_ExecuteScriptPart (JSContext *cx, JSObject *obj, JSScript *script, JSExecPart part, jsval *rval)
 JS_EvaluateScript (JSContext *cx, JSObject *obj, const char *bytes, uintN nbytes, const char *filename, uintN lineno, jsval *rval)
 JS_EvaluateScriptForPrincipals (JSContext *cx, JSObject *obj, JSPrincipals *principals, const char *bytes, uintN nbytes, const char *filename, uintN lineno, jsval *rval)
 JS_EvaluateUCScript (JSContext *cx, JSObject *obj, const jschar *chars, uintN length, const char *filename, uintN lineno, jsval *rval)
 JS_EvaluateUCScriptForPrincipals (JSContext *cx, JSObject *obj, JSPrincipals *principals, const jschar *chars, uintN length, const char *filename, uintN lineno, jsval *rval)
 JS_CallFunction (JSContext *cx, JSObject *obj, JSFunction *fun, uintN argc, jsval *argv, jsval *rval)
 JS_CallFunctionName (JSContext *cx, JSObject *obj, const char *name, uintN argc, jsval *argv, jsval *rval)
 JS_CallFunctionValue (JSContext *cx, JSObject *obj, jsval fval, uintN argc, jsval *argv, jsval *rval)
 JS_SetBranchCallback (JSContext *cx, JSBranchCallback cb)
 JS_IsRunning (JSContext *cx)
 JS_IsConstructing (JSContext *cx)
 JS_IsAssigning (JSContext *cx)
 JS_SetCallReturnValue2 (JSContext *cx, jsval v)
 JS_SaveFrameChain (JSContext *cx)
 JS_RestoreFrameChain (JSContext *cx, JSStackFrame *fp)
 JS_NewString (JSContext *cx, char *bytes, size_t nbytes)
 JS_NewStringCopyN (JSContext *cx, const char *s, size_t n)
 JS_NewStringCopyZ (JSContext *cx, const char *s)
 JS_InternString (JSContext *cx, const char *s)
 JS_NewUCString (JSContext *cx, jschar *chars, size_t length)
 JS_NewUCStringCopyN (JSContext *cx, const jschar *s, size_t n)
 JS_NewUCStringCopyZ (JSContext *cx, const jschar *s)
 JS_InternUCStringN (JSContext *cx, const jschar *s, size_t length)
 JS_InternUCString (JSContext *cx, const jschar *s)
 JS_GetStringBytes (JSString *str)
 JS_GetStringChars (JSString *str)
 JS_GetStringLength (JSString *str)
 JS_CompareStrings (JSString *str1, JSString *str2)
 JS_NewGrowableString (JSContext *cx, jschar *chars, size_t length)
 JS_NewDependentString (JSContext *cx, JSString *str, size_t start, size_t length)
 JS_ConcatStrings (JSContext *cx, JSString *left, JSString *right)
 JS_UndependString (JSContext *cx, JSString *str)
 JS_MakeStringImmutable (JSContext *cx, JSString *str)
 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_CStringsAreUTF8 ()
 JS_ReportError (JSContext *cx, const char *format,...)
 JS_ReportErrorNumber (JSContext *cx, JSErrorCallback errorCallback, void *userRef, const uintN errorNumber,...)
 JS_ReportErrorNumberUC (JSContext *cx, JSErrorCallback errorCallback, void *userRef, const uintN errorNumber,...)
 JS_ReportWarning (JSContext *cx, const char *format,...)
 JS_ReportErrorFlagsAndNumber (JSContext *cx, uintN flags, JSErrorCallback errorCallback, void *userRef, const uintN errorNumber,...)
 JS_ReportErrorFlagsAndNumberUC (JSContext *cx, uintN flags, JSErrorCallback errorCallback, void *userRef, const uintN errorNumber,...)
 JS_ReportOutOfMemory (JSContext *cx)
 JS_SetErrorReporter (JSContext *cx, JSErrorReporter er)
 JS_NewRegExpObject (JSContext *cx, char *bytes, size_t length, uintN flags)
 JS_NewUCRegExpObject (JSContext *cx, jschar *chars, size_t length, uintN flags)
 JS_SetRegExpInput (JSContext *cx, JSString *input, JSBool multiline)
 JS_ClearRegExpStatics (JSContext *cx)
 JS_ClearRegExpRoots (JSContext *cx)
 JS_SetLocaleCallbacks (JSContext *cx, JSLocaleCallbacks *callbacks)
 JS_GetLocaleCallbacks (JSContext *cx)
 JS_IsExceptionPending (JSContext *cx)
 JS_GetPendingException (JSContext *cx, jsval *vp)
 JS_SetPendingException (JSContext *cx, jsval v)
 JS_ClearPendingException (JSContext *cx)
 JS_ReportPendingException (JSContext *cx)
 JS_SaveExceptionState (JSContext *cx)
 JS_RestoreExceptionState (JSContext *cx, JSExceptionState *state)
 JS_DropExceptionState (JSContext *cx, JSExceptionState *state)
 JS_ErrorFromException (JSContext *cx, jsval v)
 JS_ThrowReportedError (JSContext *cx, const char *message, JSErrorReport *reportp)

Variables

static struct v2smap v2smap []
static JSStdName standard_class_atoms []
static JSStdName standard_class_names []
static JSStdName object_prototype_names []
static JSClass prop_iter_class

Class Documentation

struct v2smap

Definition at line 1035 of file jsapi.c.

Class Members
const char * string
JSVersion version
struct JSStdName

Definition at line 1264 of file jsapi.c.

Collaboration diagram for JSStdName:
Class Members
size_t atomOffset
JSClass * clasp
JSObjectOp init
const char * name
struct JSExceptionState

Definition at line 4900 of file jsapi.c.

Class Members
jsval exception
JSBool throwing

Define Documentation

Definition at line 1254 of file jsapi.c.

#define AUTO_NAMELEN (   s,
  n 
)    (((n) == (size_t)-1) ? js_strlen(s) : (n))

Definition at line 2508 of file jsapi.c.

#define CHECK_REQUEST (   cx)    ((void)0)

Definition at line 102 of file jsapi.c.

#define CLASP (   name)    (JSClass *)&js_##name##Class

Definition at line 1257 of file jsapi.c.

#define CLASS_ATOM_OFFSET (   name)    offsetof(JSAtomState,classAtoms[JSProto_##name])

Definition at line 1255 of file jsapi.c.

Definition at line 1259 of file jsapi.c.

Definition at line 1261 of file jsapi.c.

Definition at line 1260 of file jsapi.c.

#define JS_ADDRESSOF_VA_LIST (   ap)    (&(ap))

Definition at line 96 of file jsapi.c.

Definition at line 3285 of file jsapi.c.

Value:
JS_BEGIN_MACRO                                                            \
        if (!(cx)->fp) {                                                      \
            (cx)->weakRoots.lastInternalResult = JSVAL_NULL;                  \
            LAST_FRAME_EXCEPTION_CHECK(cx, result);                           \
        }                                                                     \
    JS_END_MACRO

Definition at line 3850 of file jsapi.c.

Value:
JS_BEGIN_MACRO                                                            \
        if (!(result) && !((cx)->options & JSOPTION_DONT_REPORT_UNCAUGHT))    \
            js_ReportUncaughtException(cx);                                   \
    JS_END_MACRO

Definition at line 3844 of file jsapi.c.

#define LAZY_ATOM (   name)    ATOM_OFFSET(lazy.name), js_##name##_str

Definition at line 1262 of file jsapi.c.

#define OFFSET_TO_ATOM (   rt,
  off 
)    (*(JSAtom **)((char*)&(rt)->atomState + (off)))

Definition at line 1256 of file jsapi.c.

Value:

Definition at line 1080 of file jsapi.c.


Typedef Documentation

typedef struct JSStdName JSStdName

Function Documentation

static JSIdArray* AddAtomToArray ( JSContext cx,
JSAtom atom,
JSIdArray ida,
jsint ip 
) [static]

Definition at line 1539 of file jsapi.c.

{
    jsint i, length;

    i = *ip;
    length = ida->length;
    if (i >= length) {
        ida = js_SetIdArrayLength(cx, ida, JS_MAX(length * 2, 8));
        if (!ida)
            return NULL;
        JS_ASSERT(i < ida->length);
    }
    ida->vector[i] = ATOM_TO_JSID(atom);
    *ip = i + 1;
    return ida;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static JSBool AlreadyHasOwnProperty ( JSContext cx,
JSObject obj,
JSAtom atom 
) [static]

Definition at line 1495 of file jsapi.c.

{
    JSScopeProperty *sprop;
    JSScope *scope;

    JS_ASSERT(OBJ_IS_NATIVE(obj));
    JS_LOCK_OBJ(cx, obj);
    scope = OBJ_SCOPE(obj);
    sprop = SCOPE_GET_PROPERTY(scope, ATOM_TO_JSID(atom));
    JS_UNLOCK_SCOPE(cx, scope);
    return sprop != NULL;
}

Here is the caller graph for this function:

static JSScript* CompileTokenStream ( JSContext cx,
JSObject obj,
JSTokenStream ts,
void tempMark,
JSBool eofp 
) [static]

Definition at line 3762 of file jsapi.c.

{
    JSBool eof;
    JSArenaPool codePool, notePool;
    JSCodeGenerator cg;
    JSScript *script;

    CHECK_REQUEST(cx);
    eof = JS_FALSE;
    JS_InitArenaPool(&codePool, "code", 1024, sizeof(jsbytecode));
    JS_InitArenaPool(&notePool, "note", 1024, sizeof(jssrcnote));
    if (!js_InitCodeGenerator(cx, &cg, &codePool, &notePool,
                              ts->filename, ts->lineno,
                              ts->principals)) {
        script = NULL;
    } else if (!js_CompileTokenStream(cx, obj, ts, &cg)) {
        script = NULL;
        eof = (ts->flags & TSF_EOF) != 0;
    } else {
        script = js_NewScriptFromCG(cx, &cg, NULL);
    }
    if (eofp)
        *eofp = eof;
    if (!js_CloseTokenStream(cx, ts)) {
        if (script)
            js_DestroyScript(cx, script);
        script = NULL;
    }
    cg.tempMark = tempMark;
    js_FinishCodeGenerator(cx, &cg);
    JS_FinishArenaPool(&codePool);
    JS_FinishArenaPool(&notePool);
    return script;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static JSBool DefineProperty ( JSContext cx,
JSObject obj,
const char *  name,
jsval  value,
JSPropertyOp  getter,
JSPropertyOp  setter,
uintN  attrs,
uintN  flags,
intN  tinyid 
) [static]

Definition at line 2483 of file jsapi.c.

{
    jsid id;
    JSAtom *atom;

    if (attrs & JSPROP_INDEX) {
        id = INT_TO_JSID(JS_PTR_TO_INT32(name));
        atom = NULL;
        attrs &= ~JSPROP_INDEX;
    } else {
        atom = js_Atomize(cx, name, strlen(name), 0);
        if (!atom)
            return JS_FALSE;
        id = ATOM_TO_JSID(atom);
    }
    if (flags != 0 && OBJ_IS_NATIVE(obj)) {
        return js_DefineNativeProperty(cx, obj, id, value, getter, setter,
                                       attrs, flags, tinyid, NULL);
    }
    return OBJ_DEFINE_PROPERTY(cx, obj, id, value, getter, setter, attrs,
                               NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static JSBool DefineUCProperty ( JSContext cx,
JSObject obj,
const jschar name,
size_t  namelen,
jsval  value,
JSPropertyOp  getter,
JSPropertyOp  setter,
uintN  attrs,
uintN  flags,
intN  tinyid 
) [static]

Definition at line 2511 of file jsapi.c.

{
    JSAtom *atom;

    atom = js_AtomizeChars(cx, name, AUTO_NAMELEN(name, namelen), 0);
    if (!atom)
        return JS_FALSE;
    if (flags != 0 && OBJ_IS_NATIVE(obj)) {
        return js_DefineNativeProperty(cx, obj, ATOM_TO_JSID(atom), value,
                                       getter, setter, attrs, flags, tinyid,
                                       NULL);
    }
    return OBJ_DEFINE_PROPERTY(cx, obj, ATOM_TO_JSID(atom), value,
                               getter, setter, attrs, NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static JSIdArray* EnumerateIfResolved ( JSContext cx,
JSObject obj,
JSAtom atom,
JSIdArray ida,
jsint ip,
JSBool foundp 
) [static]

Definition at line 1557 of file jsapi.c.

{
    *foundp = AlreadyHasOwnProperty(cx, obj, atom);
    if (*foundp)
        ida = AddAtomToArray(cx, atom, ida, ip);
    return ida;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static JSBool GetPropertyAttributes ( JSContext cx,
JSObject obj,
JSAtom atom,
uintN attrsp,
JSBool foundp,
JSPropertyOp *  getterp,
JSPropertyOp *  setterp 
) [static]

Definition at line 2695 of file jsapi.c.

{
    JSObject *obj2;
    JSProperty *prop;
    JSBool ok;

    if (!atom)
        return JS_FALSE;
    if (!OBJ_LOOKUP_PROPERTY(cx, obj, ATOM_TO_JSID(atom), &obj2, &prop))
        return JS_FALSE;

    if (!prop || obj != obj2) {
        *attrsp = 0;
        *foundp = JS_FALSE;
        if (getterp)
            *getterp = NULL;
        if (setterp)
            *setterp = NULL;
        if (prop)
            OBJ_DROP_PROPERTY(cx, obj2, prop);
        return JS_TRUE;
    }

    *foundp = JS_TRUE;
    ok = OBJ_GET_ATTRIBUTES(cx, obj, ATOM_TO_JSID(atom), prop, attrsp);
    if (ok && OBJ_IS_NATIVE(obj)) {
        JSScopeProperty *sprop = (JSScopeProperty *) prop;

        if (getterp)
            *getterp = sprop->getter;
        if (setterp)
            *setterp = sprop->setter;
    }
    OBJ_DROP_PROPERTY(cx, obj, prop);
    return ok;
}

Here is the caller graph for this function:

JS_AddArgumentFormatter ( JSContext cx,
const char *  format,
JSArgumentFormatter  formatter 
)

Definition at line 408 of file jsapi.c.

{
    size_t length;
    JSArgumentFormatMap **mpp, *map;

    length = strlen(format);
    mpp = &cx->argumentFormatMap;
    while ((map = *mpp) != NULL) {
        /* Insert before any shorter string to match before prefixes. */
        if (map->length < length)
            break;
        if (map->length == length && !strcmp(map->format, format))
            goto out;
        mpp = &map->next;
    }
    map = (JSArgumentFormatMap *) JS_malloc(cx, sizeof *map);
    if (!map)
        return JS_FALSE;
    map->format = format;
    map->length = length;
    map->next = *mpp;
    *mpp = map;
out:
    map->formatter = formatter;
    return JS_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_AddExternalStringFinalizer ( JSStringFinalizeOp  finalizer)

Definition at line 1997 of file jsapi.c.

Here is the call graph for this function:

Here is the caller graph for this function:

JS_AddNamedRoot ( JSContext cx,
void rp,
const char *  name 
)

Definition at line 1755 of file jsapi.c.

{
    CHECK_REQUEST(cx);
    return js_AddRoot(cx, rp, name);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_AddNamedRootRT ( JSRuntime rt,
void rp,
const char *  name 
)

Definition at line 1736 of file jsapi.c.

{
    return js_AddRootRT(rt, rp, name);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_AddRoot ( JSContext cx,
void rp 
)

Definition at line 1729 of file jsapi.c.

{
    CHECK_REQUEST(cx);
    return js_AddRoot(cx, rp, NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_AliasElement ( JSContext cx,
JSObject obj,
const char *  name,
jsint  alias 
)

Definition at line 3108 of file jsapi.c.

{
    JSObject *obj2;
    JSProperty *prop;
    JSScopeProperty *sprop;
    JSBool ok;

    CHECK_REQUEST(cx);
    if (!LookupProperty(cx, obj, name, &obj2, &prop))
        return JS_FALSE;
    if (!prop) {
        js_ReportIsNotDefined(cx, name);
        return JS_FALSE;
    }
    if (obj2 != obj || !OBJ_IS_NATIVE(obj)) {
        char numBuf[12];
        OBJ_DROP_PROPERTY(cx, obj2, prop);
        JS_snprintf(numBuf, sizeof numBuf, "%ld", (long)alias);
        JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_CANT_ALIAS,
                             numBuf, name, OBJ_GET_CLASS(cx, obj2)->name);
        return JS_FALSE;
    }
    sprop = (JSScopeProperty *)prop;
    ok = (js_AddNativeProperty(cx, obj, INT_TO_JSID(alias),
                               sprop->getter, sprop->setter, sprop->slot,
                               sprop->attrs, sprop->flags | SPROP_IS_ALIAS,
                               sprop->shortid)
          != NULL);
    OBJ_DROP_PROPERTY(cx, obj, prop);
    return ok;
}

Here is the call graph for this function:

JS_AliasProperty ( JSContext cx,
JSObject obj,
const char *  name,
const char *  alias 
)

Definition at line 2633 of file jsapi.c.

{
    JSObject *obj2;
    JSProperty *prop;
    JSAtom *atom;
    JSBool ok;
    JSScopeProperty *sprop;

    CHECK_REQUEST(cx);
    if (!LookupProperty(cx, obj, name, &obj2, &prop))
        return JS_FALSE;
    if (!prop) {
        js_ReportIsNotDefined(cx, name);
        return JS_FALSE;
    }
    if (obj2 != obj || !OBJ_IS_NATIVE(obj)) {
        OBJ_DROP_PROPERTY(cx, obj2, prop);
        JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_CANT_ALIAS,
                             alias, name, OBJ_GET_CLASS(cx, obj2)->name);
        return JS_FALSE;
    }
    atom = js_Atomize(cx, alias, strlen(alias), 0);
    if (!atom) {
        ok = JS_FALSE;
    } else {
        sprop = (JSScopeProperty *)prop;
        ok = (js_AddNativeProperty(cx, obj, ATOM_TO_JSID(atom),
                                   sprop->getter, sprop->setter, sprop->slot,
                                   sprop->attrs, sprop->flags | SPROP_IS_ALIAS,
                                   sprop->shortid)
              != NULL);
    }
    OBJ_DROP_PROPERTY(cx, obj, prop);
    return ok;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_BufferIsCompilableUnit ( JSContext cx,
JSObject obj,
const char *  bytes,
size_t  length 
)

Definition at line 3879 of file jsapi.c.

{
    jschar *chars;
    JSBool result;
    JSExceptionState *exnState;
    void *tempMark;
    JSTokenStream *ts;
    JSErrorReporter older;

    CHECK_REQUEST(cx);
    chars = js_InflateString(cx, bytes, &length);
    if (!chars)
        return JS_TRUE;

    /*
     * Return true on any out-of-memory error, so our caller doesn't try to
     * collect more buffered source.
     */
    result = JS_TRUE;
    exnState = JS_SaveExceptionState(cx);
    tempMark = JS_ARENA_MARK(&cx->tempPool);
    ts = js_NewTokenStream(cx, chars, length, NULL, 0, NULL);
    if (ts) {
        older = JS_SetErrorReporter(cx, NULL);
        if (!js_ParseTokenStream(cx, obj, ts) &&
            (ts->flags & TSF_UNEXPECTED_EOF)) {
            /*
             * We ran into an error.  If it was because we ran out of source,
             * we return false, so our caller will know to try to collect more
             * buffered source.
             */
            result = JS_FALSE;
        }

        JS_SetErrorReporter(cx, older);
        js_CloseTokenStream(cx, ts);
        JS_ARENA_RELEASE(&cx->tempPool, tempMark);
    }

    JS_free(cx, chars);
    JS_RestoreExceptionState(cx, exnState);
    return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_CallFunction ( JSContext cx,
JSObject obj,
JSFunction fun,
uintN  argc,
jsval argv,
jsval rval 
)

Definition at line 4319 of file jsapi.c.

{
    JSBool ok;

    CHECK_REQUEST(cx);
    ok = js_InternalCall(cx, obj, OBJECT_TO_JSVAL(fun->object), argc, argv,
                         rval);
    LAST_FRAME_CHECKS(cx, ok);
    return ok;
}

Here is the caller graph for this function:

JS_CallFunctionName ( JSContext cx,
JSObject obj,
const char *  name,
uintN  argc,
jsval argv,
jsval rval 
)

Definition at line 4332 of file jsapi.c.

{
    JSBool ok;
    jsval fval;

    CHECK_REQUEST(cx);
#if JS_HAS_XML_SUPPORT
    if (OBJECT_IS_XML(cx, obj)) {
        JSXMLObjectOps *ops;
        JSAtom *atom;

        ops = (JSXMLObjectOps *) obj->map->ops;
        atom = js_Atomize(cx, name, strlen(name), 0);
        if (!atom)
            return JS_FALSE;
        obj = ops->getMethod(cx, obj, ATOM_TO_JSID(atom), &fval);
        if (!obj)
            return JS_FALSE;
    } else
#endif
    if (!JS_GetProperty(cx, obj, name, &fval))
        return JS_FALSE;
    ok = js_InternalCall(cx, obj, fval, argc, argv, rval);
    LAST_FRAME_CHECKS(cx, ok);
    return ok;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_CallFunctionValue ( JSContext cx,
JSObject obj,
jsval  fval,
uintN  argc,
jsval argv,
jsval rval 
)

Definition at line 4361 of file jsapi.c.

{
    JSBool ok;

    CHECK_REQUEST(cx);
    ok = js_InternalCall(cx, obj, fval, argc, argv, rval);
    LAST_FRAME_CHECKS(cx, ok);
    return ok;
}

Here is the caller graph for this function:

JS_CheckAccess ( JSContext cx,
JSObject obj,
jsid  id,
JSAccessMode  mode,
jsval vp,
uintN attrsp 
)

Definition at line 3452 of file jsapi.c.

{
    CHECK_REQUEST(cx);
    return OBJ_CHECK_ACCESS(cx, obj, id, mode, vp, attrsp);
}

Definition at line 1762 of file jsapi.c.

Here is the caller graph for this function:

Definition at line 4874 of file jsapi.c.

Here is the caller graph for this function:

Definition at line 4821 of file jsapi.c.

{
    JSRegExpStatics *res;

    /* No locking required, cx is thread-private and input must be live. */
    res = &cx->regExpStatics;
    res->input = NULL;
    cx->runtime->gcPoke = JS_TRUE;
}

Definition at line 4806 of file jsapi.c.

{
    JSRegExpStatics *res;

    /* No locking required, cx is thread-private and input must be live. */
    res = &cx->regExpStatics;
    res->input = NULL;
    res->multiline = JS_FALSE;
    res->parenCount = 0;
    res->lastMatch = res->lastParen = js_EmptySubString;
    res->leftContext = res->rightContext = js_EmptySubString;
    cx->runtime->gcPoke = JS_TRUE;
}

Here is the caller graph for this function:

JS_ClearScope ( JSContext cx,
JSObject obj 
)

Definition at line 3202 of file jsapi.c.

{
    CHECK_REQUEST(cx);

    if (obj->map->ops->clear)
        obj->map->ops->clear(cx, obj);

    /* Clear cached class objects on the global object. */
    if (JS_GET_CLASS(cx, obj)->flags & JSCLASS_IS_GLOBAL) {
        JSProtoKey key;

        for (key = JSProto_Null; key < JSProto_LIMIT; key++)
            JS_SetReservedSlot(cx, obj, key, JSVAL_VOID);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_CloneFunctionObject ( JSContext cx,
JSObject funobj,
JSObject parent 
)

Definition at line 3571 of file jsapi.c.

{
    CHECK_REQUEST(cx);
    if (OBJ_GET_CLASS(cx, funobj) != &js_FunctionClass) {
        /* Indicate we cannot clone this object. */
        return funobj;
    }
    return js_CloneFunctionObject(cx, funobj, parent);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_CompareStrings ( JSString str1,
JSString str2 
)

Definition at line 4602 of file jsapi.c.

{
    return js_CompareStrings(str1, str2);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_CompileFile ( JSContext cx,
JSObject obj,
const char *  filename 
)

Definition at line 3925 of file jsapi.c.

{
    void *mark;
    JSTokenStream *ts;
    JSScript *script;

    CHECK_REQUEST(cx);
    mark = JS_ARENA_MARK(&cx->tempPool);
    ts = js_NewFileTokenStream(cx, filename, stdin);
    if (!ts)
        return NULL;
    script = CompileTokenStream(cx, obj, ts, mark, NULL);
    LAST_FRAME_CHECKS(cx, script);
    return script;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_CompileFileHandle ( JSContext cx,
JSObject obj,
const char *  filename,
FILE file 
)

Definition at line 3942 of file jsapi.c.

Here is the call graph for this function:

JS_CompileFileHandleForPrincipals ( JSContext cx,
JSObject obj,
const char *  filename,
FILE file,
JSPrincipals principals 
)

Definition at line 3949 of file jsapi.c.

{
    void *mark;
    JSTokenStream *ts;
    JSScript *script;

    CHECK_REQUEST(cx);
    mark = JS_ARENA_MARK(&cx->tempPool);
    ts = js_NewFileTokenStream(cx, NULL, file);
    if (!ts)
        return NULL;
    ts->filename = filename;
    /* XXXshaver js_NewFileTokenStream should do this, because it drops */
    if (principals) {
        ts->principals = principals;
        JSPRINCIPALS_HOLD(cx, ts->principals);
    }
    script = CompileTokenStream(cx, obj, ts, mark, NULL);
    LAST_FRAME_CHECKS(cx, script);
    return script;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_CompileFunction ( JSContext cx,
JSObject obj,
const char *  name,
uintN  nargs,
const char **  argnames,
const char *  bytes,
size_t  length,
const char *  filename,
uintN  lineno 
)

Definition at line 4006 of file jsapi.c.

{
    jschar *chars;
    JSFunction *fun;

    CHECK_REQUEST(cx);
    chars = js_InflateString(cx, bytes, &length);
    if (!chars)
        return NULL;
    fun = JS_CompileUCFunction(cx, obj, name, nargs, argnames, chars, length,
                               filename, lineno);
    JS_free(cx, chars);
    return fun;
}

Here is the call graph for this function:

JS_CompileFunctionForPrincipals ( JSContext cx,
JSObject obj,
JSPrincipals principals,
const char *  name,
uintN  nargs,
const char **  argnames,
const char *  bytes,
size_t  length,
const char *  filename,
uintN  lineno 
)

Definition at line 4025 of file jsapi.c.

{
    jschar *chars;
    JSFunction *fun;

    CHECK_REQUEST(cx);
    chars = js_InflateString(cx, bytes, &length);
    if (!chars)
        return NULL;
    fun = JS_CompileUCFunctionForPrincipals(cx, obj, principals, name,
                                            nargs, argnames, chars, length,
                                            filename, lineno);
    JS_free(cx, chars);
    return fun;
}

Here is the call graph for this function:

JS_CompileScript ( JSContext cx,
JSObject obj,
const char *  bytes,
size_t  length,
const char *  filename,
uintN  lineno 
)

Definition at line 3799 of file jsapi.c.

{
    jschar *chars;
    JSScript *script;

    CHECK_REQUEST(cx);
    chars = js_InflateString(cx, bytes, &length);
    if (!chars)
        return NULL;
    script = JS_CompileUCScript(cx, obj, chars, length, filename, lineno);
    JS_free(cx, chars);
    return script;
}

Here is the call graph for this function:

JS_CompileScriptForPrincipals ( JSContext cx,
JSObject obj,
JSPrincipals principals,
const char *  bytes,
size_t  length,
const char *  filename,
uintN  lineno 
)

Definition at line 3816 of file jsapi.c.

{
    jschar *chars;
    JSScript *script;

    CHECK_REQUEST(cx);
    chars = js_InflateString(cx, bytes, &length);
    if (!chars)
        return NULL;
    script = JS_CompileUCScriptForPrincipals(cx, obj, principals,
                                             chars, length, filename, lineno);
    JS_free(cx, chars);
    return script;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_CompileUCFunction ( JSContext cx,
JSObject obj,
const char *  name,
uintN  nargs,
const char **  argnames,
const jschar chars,
size_t  length,
const char *  filename,
uintN  lineno 
)

Definition at line 4046 of file jsapi.c.

Here is the call graph for this function:

Here is the caller graph for this function:

JS_CompileUCFunctionForPrincipals ( JSContext cx,
JSObject obj,
JSPrincipals principals,
const char *  name,
uintN  nargs,
const char **  argnames,
const jschar chars,
size_t  length,
const char *  filename,
uintN  lineno 
)

Definition at line 4059 of file jsapi.c.

{
    void *mark;
    JSTokenStream *ts;
    JSFunction *fun;
    JSAtom *funAtom, *argAtom;
    JSTempValueRooter tvr;
    uintN i;

    CHECK_REQUEST(cx);
    mark = JS_ARENA_MARK(&cx->tempPool);
    ts = js_NewTokenStream(cx, chars, length, filename, lineno, principals);
    if (!ts) {
        fun = NULL;
        goto out2;
    }
    if (!name) {
        funAtom = NULL;
    } else {
        funAtom = js_Atomize(cx, name, strlen(name), 0);
        if (!funAtom) {
            fun = NULL;
            goto out2;
        }
    }
    fun = js_NewFunction(cx, NULL, NULL, nargs, 0, obj, funAtom);
    if (!fun)
        goto out2;

    /* From this point the control must flow through the label out. */
    JS_PUSH_TEMP_ROOT_OBJECT(cx, fun->object, &tvr);
    if (nargs) {
        for (i = 0; i < nargs; i++) {
            argAtom = js_Atomize(cx, argnames[i], strlen(argnames[i]), 0);
            if (!argAtom)
                break;
            if (!js_AddHiddenProperty(cx, fun->object, ATOM_TO_JSID(argAtom),
                                      js_GetArgument, js_SetArgument,
                                      SPROP_INVALID_SLOT,
                                      JSPROP_PERMANENT | JSPROP_SHARED,
                                      SPROP_HAS_SHORTID, i)) {
                break;
            }
        }
        if (i < nargs) {
            fun = NULL;
            goto out;
        }
    }
    if (!js_CompileFunctionBody(cx, ts, fun)) {
        fun = NULL;
        goto out;
    }
    if (obj && funAtom) {
        if (!OBJ_DEFINE_PROPERTY(cx, obj, ATOM_TO_JSID(funAtom),
                                 OBJECT_TO_JSVAL(fun->object),
                                 NULL, NULL, JSPROP_ENUMERATE, NULL)) {
            fun = NULL;
            goto out;
        }
    }
    cx->weakRoots.newborn[GCX_OBJECT] = (JSGCThing *) fun->object;

  out:
    JS_POP_TEMP_ROOT(cx, &tvr);

  out2:
    if (ts)
        js_CloseTokenStream(cx, ts);
    JS_ARENA_RELEASE(&cx->tempPool, mark);
    LAST_FRAME_CHECKS(cx, fun);
    return fun;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_CompileUCScript ( JSContext cx,
JSObject obj,
const jschar chars,
size_t  length,
const char *  filename,
uintN  lineno 
)

Definition at line 3835 of file jsapi.c.

Here is the call graph for this function:

Here is the caller graph for this function:

JS_CompileUCScriptForPrincipals ( JSContext cx,
JSObject obj,
JSPrincipals principals,
const jschar chars,
size_t  length,
const char *  filename,
uintN  lineno 
)

Definition at line 3859 of file jsapi.c.

{
    void *mark;
    JSTokenStream *ts;
    JSScript *script;

    CHECK_REQUEST(cx);
    mark = JS_ARENA_MARK(&cx->tempPool);
    ts = js_NewTokenStream(cx, chars, length, filename, lineno, principals);
    if (!ts)
        return NULL;
    script = CompileTokenStream(cx, obj, ts, mark, NULL);
    LAST_FRAME_CHECKS(cx, script);
    return script;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_ConcatStrings ( JSContext cx,
JSString left,
JSString right 
)

Definition at line 4623 of file jsapi.c.

{
    CHECK_REQUEST(cx);
    return js_ConcatStrings(cx, left, right);
}

Here is the call graph for this function:

JS_ConstructObject ( JSContext cx,
JSClass clasp,
JSObject proto,
JSObject parent 
)

Definition at line 2463 of file jsapi.c.

{
    CHECK_REQUEST(cx);
    if (!clasp)
        clasp = &js_ObjectClass;    /* default class is Object */
    return js_ConstructObject(cx, clasp, proto, parent, 0, NULL);
}

Here is the call graph for this function:

JS_ConstructObjectWithArguments ( JSContext cx,
JSClass clasp,
JSObject proto,
JSObject parent,
uintN  argc,
jsval argv 
)

Definition at line 2473 of file jsapi.c.

{
    CHECK_REQUEST(cx);
    if (!clasp)
        clasp = &js_ObjectClass;    /* default class is Object */
    return js_ConstructObject(cx, clasp, proto, parent, argc, argv);
}

Here is the call graph for this function:

JS_ContextIterator ( JSRuntime rt,
JSContext **  iterp 
)

Definition at line 1003 of file jsapi.c.

{
    return js_ContextIterator(rt, JS_TRUE, iterp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_ConvertArguments ( JSContext cx,
uintN  argc,
jsval argv,
const char *  format,
  ... 
)

Definition at line 154 of file jsapi.c.

{
    va_list ap;
    JSBool ok;

    va_start(ap, format);
    ok = JS_ConvertArgumentsVA(cx, argc, argv, format, ap);
    va_end(ap);
    return ok;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_ConvertArgumentsVA ( JSContext cx,
uintN  argc,
jsval argv,
const char *  format,
va_list  ap 
)

Definition at line 167 of file jsapi.c.

{
    jsval *sp;
    JSBool required;
    char c;
    JSFunction *fun;
    jsdouble d;
    JSString *str;
    JSObject *obj;

    CHECK_REQUEST(cx);
    sp = argv;
    required = JS_TRUE;
    while ((c = *format++) != '\0') {
        if (isspace(c))
            continue;
        if (c == '/') {
            required = JS_FALSE;
            continue;
        }
        if (sp == argv + argc) {
            if (required) {
                fun = js_ValueToFunction(cx, &argv[-2], 0);
                if (fun) {
                    char numBuf[12];
                    JS_snprintf(numBuf, sizeof numBuf, "%u", argc);
                    JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
                                         JSMSG_MORE_ARGS_NEEDED,
                                         JS_GetFunctionName(fun), numBuf,
                                         (argc == 1) ? "" : "s");
                }
                return JS_FALSE;
            }
            break;
        }
        switch (c) {
          case 'b':
            if (!js_ValueToBoolean(cx, *sp, va_arg(ap, JSBool *)))
                return JS_FALSE;
            break;
          case 'c':
            if (!js_ValueToUint16(cx, *sp, va_arg(ap, uint16 *)))
                return JS_FALSE;
            break;
          case 'i':
            if (!js_ValueToECMAInt32(cx, *sp, va_arg(ap, int32 *)))
                return JS_FALSE;
            break;
          case 'u':
            if (!js_ValueToECMAUint32(cx, *sp, va_arg(ap, uint32 *)))
                return JS_FALSE;
            break;
          case 'j':
            if (!js_ValueToInt32(cx, *sp, va_arg(ap, int32 *)))
                return JS_FALSE;
            break;
          case 'd':
            if (!js_ValueToNumber(cx, *sp, va_arg(ap, jsdouble *)))
                return JS_FALSE;
            break;
          case 'I':
            if (!js_ValueToNumber(cx, *sp, &d))
                return JS_FALSE;
            *va_arg(ap, jsdouble *) = js_DoubleToInteger(d);
            break;
          case 's':
          case 'S':
          case 'W':
            str = js_ValueToString(cx, *sp);
            if (!str)
                return JS_FALSE;
            *sp = STRING_TO_JSVAL(str);
            if (c == 's')
                *va_arg(ap, char **) = JS_GetStringBytes(str);
            else if (c == 'W')
                *va_arg(ap, jschar **) = JS_GetStringChars(str);
            else
                *va_arg(ap, JSString **) = str;
            break;
          case 'o':
            if (!js_ValueToObject(cx, *sp, &obj))
                return JS_FALSE;
            *sp = OBJECT_TO_JSVAL(obj);
            *va_arg(ap, JSObject **) = obj;
            break;
          case 'f':
            obj = js_ValueToFunctionObject(cx, sp, 0);
            if (!obj)
                return JS_FALSE;
            *va_arg(ap, JSFunction **) = (JSFunction *) JS_GetPrivate(cx, obj);
            break;
          case 'v':
            *va_arg(ap, jsval *) = *sp;
            break;
          case '*':
            break;
          default:
            format--;
            if (!TryArgumentFormatter(cx, &format, JS_TRUE, &sp,
                                      JS_ADDRESSOF_VA_LIST(ap))) {
                return JS_FALSE;
            }
            /* NB: the formatter already updated sp, so we continue here. */
            continue;
        }
        sp++;
    }
    return JS_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_ConvertStub ( JSContext cx,
JSObject obj,
JSType  type,
jsval vp 
)

Definition at line 2103 of file jsapi.c.

{
    return js_TryValueOf(cx, obj, type, vp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_ConvertValue ( JSContext cx,
jsval  v,
JSType  type,
jsval vp 
)

Definition at line 455 of file jsapi.c.

{
    JSBool ok, b;
    JSObject *obj;
    JSString *str;
    jsdouble d, *dp;

    CHECK_REQUEST(cx);
    switch (type) {
      case JSTYPE_VOID:
        *vp = JSVAL_VOID;
        ok = JS_TRUE;
        break;
      case JSTYPE_OBJECT:
        ok = js_ValueToObject(cx, v, &obj);
        if (ok)
            *vp = OBJECT_TO_JSVAL(obj);
        break;
      case JSTYPE_FUNCTION:
        *vp = v;
        obj = js_ValueToFunctionObject(cx, vp, JSV2F_SEARCH_STACK);
        ok = (obj != NULL);
        break;
      case JSTYPE_STRING:
        str = js_ValueToString(cx, v);
        ok = (str != NULL);
        if (ok)
            *vp = STRING_TO_JSVAL(str);
        break;
      case JSTYPE_NUMBER:
        ok = js_ValueToNumber(cx, v, &d);
        if (ok) {
            dp = js_NewDouble(cx, d, 0);
            ok = (dp != NULL);
            if (ok)
                *vp = DOUBLE_TO_JSVAL(dp);
        }
        break;
      case JSTYPE_BOOLEAN:
        ok = js_ValueToBoolean(cx, v, &b);
        if (ok)
            *vp = BOOLEAN_TO_JSVAL(b);
        break;
      default: {
        char numBuf[12];
        JS_snprintf(numBuf, sizeof numBuf, "%d", (int)type);
        JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_BAD_TYPE,
                             numBuf);
        ok = JS_FALSE;
        break;
      }
    }
    return ok;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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_DecompileFunction ( JSContext cx,
JSFunction fun,
uintN  indent 
)

Definition at line 4159 of file jsapi.c.

{
    JSPrinter *jp;
    JSString *str;

    CHECK_REQUEST(cx);
    jp = js_NewPrinter(cx, JS_GetFunctionName(fun),
                       indent & ~JS_DONT_PRETTY_PRINT,
                       !(indent & JS_DONT_PRETTY_PRINT));
    if (!jp)
        return NULL;
    if (js_DecompileFunction(jp, fun))
        str = js_GetPrinterOutput(jp);
    else
        str = NULL;
    js_DestroyPrinter(jp);
    return str;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_DecompileFunctionBody ( JSContext cx,
JSFunction fun,
uintN  indent 
)

Definition at line 4179 of file jsapi.c.

{
    JSPrinter *jp;
    JSString *str;

    CHECK_REQUEST(cx);
    jp = js_NewPrinter(cx, JS_GetFunctionName(fun),
                       indent & ~JS_DONT_PRETTY_PRINT,
                       !(indent & JS_DONT_PRETTY_PRINT));
    if (!jp)
        return NULL;
    if (js_DecompileFunctionBody(jp, fun))
        str = js_GetPrinterOutput(jp);
    else
        str = NULL;
    js_DestroyPrinter(jp);
    return str;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_DecompileScript ( JSContext cx,
JSScript script,
const char *  name,
uintN  indent 
)

Definition at line 4138 of file jsapi.c.

{
    JSPrinter *jp;
    JSString *str;

    CHECK_REQUEST(cx);
    jp = js_NewPrinter(cx, name,
                       indent & ~JS_DONT_PRETTY_PRINT,
                       !(indent & JS_DONT_PRETTY_PRINT));
    if (!jp)
        return NULL;
    if (js_DecompileScript(jp, script))
        str = js_GetPrinterOutput(jp);
    else
        str = NULL;
    js_DestroyPrinter(jp);
    return str;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2551 of file jsapi.c.

{
    JSBool ok;
    jsval value;
    uintN flags;

    CHECK_REQUEST(cx);
    for (ok = JS_TRUE; cds->name; cds++) {
        ok = js_NewNumberValue(cx, cds->dval, &value);
        if (!ok)
            break;
        flags = cds->flags;
        if (!flags)
            flags = JSPROP_READONLY | JSPROP_PERMANENT;
        ok = DefineProperty(cx, obj, cds->name, value, NULL, NULL, flags, 0, 0);
        if (!ok)
            break;
    }
    return ok;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_DefineElement ( JSContext cx,
JSObject obj,
jsint  index,
jsval  value,
JSPropertyOp  getter,
JSPropertyOp  setter,
uintN  attrs 
)

Definition at line 3099 of file jsapi.c.

Here is the caller graph for this function:

JS_DefineFunction ( JSContext cx,
JSObject obj,
const char *  name,
JSNative  call,
uintN  nargs,
uintN  attrs 
)

Definition at line 3736 of file jsapi.c.

{
    JSAtom *atom;

    CHECK_REQUEST(cx);
    atom = js_Atomize(cx, name, strlen(name), 0);
    if (!atom)
        return NULL;
    return js_DefineFunction(cx, obj, atom, call, nargs, attrs);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_DefineFunctions ( JSContext cx,
JSObject obj,
JSFunctionSpec fs 
)

Definition at line 3686 of file jsapi.c.

{
    uintN flags;
    JSObject *ctor;
    JSFunction *fun;

    CHECK_REQUEST(cx);
    ctor = NULL;
    for (; fs->name; fs++) {

        /* High bits of fs->extra are reserved. */
        JS_ASSERT((fs->extra & 0xFFFF0000) == 0);
        flags = fs->flags;

        /*
         * Define a generic arity N+1 static method for the arity N prototype
         * method if flags contains JSFUN_GENERIC_NATIVE.
         */
        if (flags & JSFUN_GENERIC_NATIVE) {
            if (!ctor) {
                ctor = JS_GetConstructor(cx, obj);
                if (!ctor)
                    return JS_FALSE;
            }

            flags &= ~JSFUN_GENERIC_NATIVE;
            fun = JS_DefineFunction(cx, ctor, fs->name,
                                    js_generic_native_method_dispatcher,
                                    fs->nargs + 1, flags);
            if (!fun)
                return JS_FALSE;
            fun->u.n.extra = (uint16)fs->extra;

            /*
             * As jsapi.h notes, fs must point to storage that lives as long
             * as fun->object lives.
             */
            if (!JS_SetReservedSlot(cx, fun->object, 0, PRIVATE_TO_JSVAL(fs)))
                return JS_FALSE;
        }

        fun = JS_DefineFunction(cx, obj, fs->name, fs->call, fs->nargs, flags);
        if (!fun)
            return JS_FALSE;
        fun->u.n.extra = (uint16)fs->extra;
    }
    return JS_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_DefineObject ( JSContext cx,
JSObject obj,
const char *  name,
JSClass clasp,
JSObject proto,
uintN  attrs 
)

Definition at line 2531 of file jsapi.c.

{
    JSObject *nobj;

    CHECK_REQUEST(cx);
    if (!clasp)
        clasp = &js_ObjectClass;    /* default class is Object */
    nobj = js_NewObject(cx, clasp, proto, obj);
    if (!nobj)
        return NULL;
    if (!DefineProperty(cx, obj, name, OBJECT_TO_JSVAL(nobj), NULL, NULL, attrs,
                        0, 0)) {
        cx->weakRoots.newborn[GCX_OBJECT] = NULL;
        return NULL;
    }
    return nobj;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_DefineProperties ( JSContext cx,
JSObject obj,
JSPropertySpec ps 
)

Definition at line 2573 of file jsapi.c.

{
    JSBool ok;

    CHECK_REQUEST(cx);
    for (ok = JS_TRUE; ps->name; ps++) {
        ok = DefineProperty(cx, obj, ps->name, JSVAL_VOID,
                            ps->getter, ps->setter, ps->flags,
                            SPROP_HAS_SHORTID, ps->tinyid);
        if (!ok)
            break;
    }
    return ok;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_DefineProperty ( JSContext cx,
JSObject obj,
const char *  name,
jsval  value,
JSPropertyOp  getter,
JSPropertyOp  setter,
uintN  attrs 
)

Definition at line 2589 of file jsapi.c.

{
    CHECK_REQUEST(cx);
    return DefineProperty(cx, obj, name, value, getter, setter, attrs, 0, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_DefinePropertyWithTinyId ( JSContext cx,
JSObject obj,
const char *  name,
int8  tinyid,
jsval  value,
JSPropertyOp  getter,
JSPropertyOp  setter,
uintN  attrs 
)

Definition at line 2597 of file jsapi.c.

Here is the call graph for this function:

JS_DefineUCFunction ( JSContext cx,
JSObject obj,
const jschar name,
size_t  namelen,
JSNative  call,
uintN  nargs,
uintN  attrs 
)

Definition at line 3749 of file jsapi.c.

{
    JSAtom *atom;

    atom = js_AtomizeChars(cx, name, AUTO_NAMELEN(name, namelen), 0);
    if (!atom)
        return NULL;
    return js_DefineFunction(cx, obj, atom, call, nargs, attrs);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_DefineUCProperty ( JSContext cx,
JSObject obj,
const jschar name,
size_t  namelen,
jsval  value,
JSPropertyOp  getter,
JSPropertyOp  setter,
uintN  attrs 
)

Definition at line 2929 of file jsapi.c.

{
    CHECK_REQUEST(cx);
    return DefineUCProperty(cx, obj, name, namelen, value, getter, setter,
                            attrs, 0, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_DefineUCPropertyWithTinyId ( JSContext cx,
JSObject obj,
const jschar name,
size_t  namelen,
int8  tinyid,
jsval  value,
JSPropertyOp  getter,
JSPropertyOp  setter,
uintN  attrs 
)

Definition at line 2975 of file jsapi.c.

Here is the call graph for this function:

JS_DeleteElement ( JSContext cx,
JSObject obj,
jsint  index 
)

Definition at line 3186 of file jsapi.c.

{
    jsval junk;

    CHECK_REQUEST(cx);
    return JS_DeleteElement2(cx, obj, index, &junk);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_DeleteElement2 ( JSContext cx,
JSObject obj,
jsint  index,
jsval rval 
)

Definition at line 3195 of file jsapi.c.

Here is the caller graph for this function:

JS_DeleteProperty ( JSContext cx,
JSObject obj,
const char *  name 
)

Definition at line 2907 of file jsapi.c.

{
    jsval junk;

    CHECK_REQUEST(cx);
    return JS_DeleteProperty2(cx, obj, name, &junk);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_DeleteProperty2 ( JSContext cx,
JSObject obj,
const char *  name,
jsval rval 
)

Definition at line 2916 of file jsapi.c.

{
    JSAtom *atom;

    CHECK_REQUEST(cx);
    atom = js_Atomize(cx, name, strlen(name), 0);
    if (!atom)
        return JS_FALSE;
    return OBJ_DELETE_PROPERTY(cx, obj, ATOM_TO_JSID(atom), rval);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_DeleteUCProperty2 ( JSContext cx,
JSObject obj,
const jschar name,
size_t  namelen,
jsval rval 
)

Definition at line 3050 of file jsapi.c.

{
    JSAtom *atom;

    CHECK_REQUEST(cx);
    atom = js_AtomizeChars(cx, name, AUTO_NAMELEN(name, namelen), 0);
    if (!atom)
        return JS_FALSE;
    return OBJ_DELETE_PROPERTY(cx, obj, ATOM_TO_JSID(atom), rval);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 967 of file jsapi.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 979 of file jsapi.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 973 of file jsapi.c.

Here is the call graph for this function:

Here is the caller graph for this function:

JS_DestroyIdArray ( JSContext cx,
JSIdArray ida 
)

Definition at line 2048 of file jsapi.c.

{
    JS_free(cx, ida);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 744 of file jsapi.c.

{
#ifdef DEBUG
    /* Don't hurt everyone in leaky ol' Mozilla with a fatal JS_ASSERT! */
    if (!JS_CLIST_IS_EMPTY(&rt->contextList)) {
        JSContext *cx, *iter = NULL;
        uintN cxcount = 0;
        while ((cx = js_ContextIterator(rt, JS_TRUE, &iter)) != NULL)
            cxcount++;
        fprintf(stderr,
"JS API usage error: %u contexts left in runtime upon JS_DestroyRuntime.\n",
                cxcount);
    }
#endif

    js_FreeRuntimeScriptState(rt);
    js_FinishAtomState(&rt->atomState);
    js_FinishGC(rt);
#ifdef JS_THREADSAFE
    if (rt->gcLock)
        JS_DESTROY_LOCK(rt->gcLock);
    if (rt->gcDone)
        JS_DESTROY_CONDVAR(rt->gcDone);
    if (rt->requestDone)
        JS_DESTROY_CONDVAR(rt->requestDone);
    if (rt->rtLock)
        JS_DESTROY_LOCK(rt->rtLock);
    if (rt->stateChange)
        JS_DESTROY_CONDVAR(rt->stateChange);
    if (rt->setSlotLock)
        JS_DESTROY_LOCK(rt->setSlotLock);
    if (rt->setSlotDone)
        JS_DESTROY_CONDVAR(rt->setSlotDone);
    if (rt->scopeSharingDone)
        JS_DESTROY_CONDVAR(rt->scopeSharingDone);
#else
    GSN_CACHE_CLEAR(&rt->gsnCache);
#endif
    js_FinishPropertyTree(rt);
    free(rt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_DestroyScript ( JSContext cx,
JSScript script 
)

Definition at line 3999 of file jsapi.c.

{
    CHECK_REQUEST(cx);
    js_DestroyScript(cx, script);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 4934 of file jsapi.c.

{
    CHECK_REQUEST(cx);
    if (state) {
        if (state->throwing && JSVAL_IS_GCTHING(state->exception))
            JS_RemoveRoot(cx, &state->exception);
        JS_free(cx, state);
    }
}

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 1768 of file jsapi.c.

Here is the call graph for this function:

JS_Enumerate ( JSContext cx,
JSObject obj 
)

Definition at line 3219 of file jsapi.c.

{
    jsint i, n;
    jsval iter_state, num_properties;
    jsid id;
    JSIdArray *ida;
    jsval *vector;

    CHECK_REQUEST(cx);

    ida = NULL;
    iter_state = JSVAL_NULL;

    /* Get the number of properties to enumerate. */
    if (!OBJ_ENUMERATE(cx, obj, JSENUMERATE_INIT, &iter_state, &num_properties))
        goto error;
    if (!JSVAL_IS_INT(num_properties)) {
        JS_ASSERT(0);
        goto error;
    }

    /* Grow as needed if we don't know the exact amount ahead of time. */
    n = JSVAL_TO_INT(num_properties);
    if (n <= 0)
        n = 8;

    /* Create an array of jsids large enough to hold all the properties */
    ida = js_NewIdArray(cx, n);
    if (!ida)
        goto error;

    i = 0;
    vector = &ida->vector[0];
    for (;;) {
        if (!OBJ_ENUMERATE(cx, obj, JSENUMERATE_NEXT, &iter_state, &id))
            goto error;

        /* No more jsid's to enumerate ? */
        if (iter_state == JSVAL_NULL)
            break;

        if (i == ida->length) {
            ida = js_SetIdArrayLength(cx, ida, ida->length * 2);
            if (!ida)
                goto error;
            vector = &ida->vector[0];
        }
        vector[i++] = id;
    }
    return js_SetIdArrayLength(cx, ida, i);

error:
    if (iter_state != JSVAL_NULL)
        OBJ_ENUMERATE(cx, obj, JSENUMERATE_DESTROY, &iter_state, 0);
    if (ida)
        JS_DestroyIdArray(cx, ida);
    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1567 of file jsapi.c.

{
    JSRuntime *rt;
    jsint i, j, k;
    JSAtom *atom;
    JSBool found;
    JSObjectOp init;

    CHECK_REQUEST(cx);
    rt = cx->runtime;
    if (ida) {
        i = ida->length;
    } else {
        ida = js_NewIdArray(cx, 8);
        if (!ida)
            return NULL;
        i = 0;
    }

    /* Check whether 'undefined' has been resolved and enumerate it if so. */
    atom = rt->atomState.typeAtoms[JSTYPE_VOID];
    ida = EnumerateIfResolved(cx, obj, atom, ida, &i, &found);
    if (!ida)
        return NULL;

    /* Enumerate only classes that *have* been resolved. */
    for (j = 0; standard_class_atoms[j].init; j++) {
        atom = OFFSET_TO_ATOM(rt, standard_class_atoms[j].atomOffset);
        ida = EnumerateIfResolved(cx, obj, atom, ida, &i, &found);
        if (!ida)
            return NULL;

        if (found) {
            init = standard_class_atoms[j].init;

            for (k = 0; standard_class_names[k].init; k++) {
                if (standard_class_names[k].init == init) {
                    atom = StdNameToAtom(cx, &standard_class_names[k]);
                    ida = AddAtomToArray(cx, atom, ida, &i);
                    if (!ida)
                        return NULL;
                }
            }

            if (init == js_InitObjectClass) {
                for (k = 0; object_prototype_names[k].init; k++) {
                    atom = StdNameToAtom(cx, &object_prototype_names[k]);
                    ida = AddAtomToArray(cx, atom, ida, &i);
                    if (!ida)
                        return NULL;
                }
            }
        }
    }

    /* Trim to exact length via js_SetIdArrayLength. */
    return js_SetIdArrayLength(cx, ida, i);
}

Here is the call graph for this function:

Definition at line 1509 of file jsapi.c.

{
    JSRuntime *rt;
    JSAtom *atom;
    uintN i;

    CHECK_REQUEST(cx);
    rt = cx->runtime;

    /* Check whether we need to bind 'undefined' and define it if so. */
    atom = rt->atomState.typeAtoms[JSTYPE_VOID];
    if (!AlreadyHasOwnProperty(cx, obj, atom) &&
        !OBJ_DEFINE_PROPERTY(cx, obj, ATOM_TO_JSID(atom), JSVAL_VOID,
                             NULL, NULL, JSPROP_PERMANENT, NULL)) {
        return JS_FALSE;
    }

    /* Initialize any classes that have not been resolved yet. */
    for (i = 0; standard_class_atoms[i].init; i++) {
        atom = OFFSET_TO_ATOM(rt, standard_class_atoms[i].atomOffset);
        if (!AlreadyHasOwnProperty(cx, obj, atom) &&
            !standard_class_atoms[i].init(cx, obj)) {
            return JS_FALSE;
        }
    }

    return JS_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_EnumerateStub ( JSContext cx,
JSObject obj 
)

Definition at line 2091 of file jsapi.c.

{
    return JS_TRUE;
}

Here is the caller graph for this function:

Definition at line 4945 of file jsapi.c.

{
    CHECK_REQUEST(cx);
    return js_ErrorFromException(cx, v);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_EvaluateScript ( JSContext cx,
JSObject obj,
const char *  bytes,
uintN  nbytes,
const char *  filename,
uintN  lineno,
jsval rval 
)

Definition at line 4242 of file jsapi.c.

{
    size_t length = nbytes;
    jschar *chars;
    JSBool ok;

    CHECK_REQUEST(cx);
    chars = js_InflateString(cx, bytes, &length);
    if (!chars)
        return JS_FALSE;
    ok = JS_EvaluateUCScript(cx, obj, chars, length, filename, lineno, rval);
    JS_free(cx, chars);
    return ok;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_EvaluateScriptForPrincipals ( JSContext cx,
JSObject obj,
JSPrincipals principals,
const char *  bytes,
uintN  nbytes,
const char *  filename,
uintN  lineno,
jsval rval 
)

Definition at line 4262 of file jsapi.c.

{
    size_t length = nbytes;
    jschar *chars;
    JSBool ok;

    CHECK_REQUEST(cx);
    chars = js_InflateString(cx, bytes, &length);
    if (!chars)
        return JS_FALSE;
    ok = JS_EvaluateUCScriptForPrincipals(cx, obj, principals, chars, length,
                                          filename, lineno, rval);
    JS_free(cx, chars);
    return ok;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_EvaluateUCScript ( JSContext cx,
JSObject obj,
const jschar chars,
uintN  length,
const char *  filename,
uintN  lineno,
jsval rval 
)

Definition at line 4283 of file jsapi.c.

Here is the call graph for this function:

Here is the caller graph for this function:

JS_EvaluateUCScriptForPrincipals ( JSContext cx,
JSObject obj,
JSPrincipals principals,
const jschar chars,
uintN  length,
const char *  filename,
uintN  lineno,
jsval rval 
)

Definition at line 4294 of file jsapi.c.

{
    uint32 options;
    JSScript *script;
    JSBool ok;

    CHECK_REQUEST(cx);
    options = cx->options;
    cx->options = options | JSOPTION_COMPILE_N_GO;
    script = JS_CompileUCScriptForPrincipals(cx, obj, principals, chars, length,
                                             filename, lineno);
    cx->options = options;
    if (!script)
        return JS_FALSE;
    ok = js_Execute(cx, obj, script, NULL, 0, rval);
    LAST_FRAME_CHECKS(cx, ok);
    JS_DestroyScript(cx, script);
    return ok;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_ExecuteScript ( JSContext cx,
JSObject obj,
JSScript script,
jsval rval 
)

Definition at line 4199 of file jsapi.c.

{
    JSBool ok;

    CHECK_REQUEST(cx);
    ok = js_Execute(cx, obj, script, NULL, 0, rval);
    LAST_FRAME_CHECKS(cx, ok);
    return ok;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_ExecuteScriptPart ( JSContext cx,
JSObject obj,
JSScript script,
JSExecPart  part,
jsval rval 
)

Definition at line 4210 of file jsapi.c.

{
    JSScript tmp;
    JSRuntime *rt;
    JSBool ok;

    /* Make a temporary copy of the JSScript structure and farble it a bit. */
    tmp = *script;
    if (part == JSEXEC_PROLOG) {
        tmp.length = PTRDIFF(tmp.main, tmp.code, jsbytecode);
    } else {
        tmp.length -= PTRDIFF(tmp.main, tmp.code, jsbytecode);
        tmp.code = tmp.main;
    }

    /* Tell the debugger about our temporary copy of the script structure. */
    rt = cx->runtime;
    if (rt->newScriptHook) {
        rt->newScriptHook(cx, tmp.filename, tmp.lineno, &tmp, NULL,
                          rt->newScriptHookData);
    }

    /* Execute the farbled struct and tell the debugger to forget about it. */
    ok = JS_ExecuteScript(cx, obj, &tmp, rval);
    if (rt->destroyScriptHook)
        rt->destroyScriptHook(cx, &tmp, rt->destroyScriptHookData);
    return ok;
}

Here is the call graph for this function:

JS_FinalizeStub ( JSContext cx,
JSObject obj 
)

Definition at line 2109 of file jsapi.c.

{
}
JS_ForgetLocalRoot ( JSContext cx,
void thing 
)

Definition at line 1789 of file jsapi.c.

Here is the call graph for this function:

JS_free ( JSContext cx,
void p 
)

Definition at line 1687 of file jsapi.c.

{
    if (p)
        free(p);
}
JS_GC ( JSContext cx)

Definition at line 1861 of file jsapi.c.

{
#if JS_HAS_GENERATORS
    /* Run previously scheduled but delayed close hooks. */
    js_RunCloseHooks(cx);
#endif

    /* Don't nuke active arenas if executing or compiling. */
    if (cx->stackPool.current == &cx->stackPool.first)
        JS_FinishArenaPool(&cx->stackPool);
    if (cx->tempPool.current == &cx->tempPool.first)
        JS_FinishArenaPool(&cx->tempPool);
    js_GC(cx, GC_NORMAL);

#if JS_HAS_GENERATORS
    /*
     * Run close hooks for objects that became unreachable after the last GC.
     */
    js_RunCloseHooks(cx);
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

js_generic_native_method_dispatcher ( JSContext cx,
JSObject obj,
uintN  argc,
jsval argv,
jsval rval 
)

Definition at line 3630 of file jsapi.c.

{
    jsval fsv;
    JSFunctionSpec *fs;
    JSObject *tmp;

    if (!JS_GetReservedSlot(cx, JSVAL_TO_OBJECT(argv[-2]), 0, &fsv))
        return JS_FALSE;
    fs = (JSFunctionSpec *) JSVAL_TO_PRIVATE(fsv);

    /*
     * We know that argv[0] is valid because JS_DefineFunctions, which is our
     * only (indirect) referrer, defined us as requiring at least one argument
     * (notice how it passes fs->nargs + 1 as the next-to-last argument to
     * JS_DefineFunction).
     */
    if (JSVAL_IS_PRIMITIVE(argv[0])) {
        /*
         * Make sure that this is an object or null, as required by the generic
         * functions.
         */
        if (!js_ValueToObject(cx, argv[0], &tmp))
            return JS_FALSE;
        argv[0] = OBJECT_TO_JSVAL(tmp);
    }

    /*
     * Copy all actual (argc) and required but missing (fs->nargs + 1 - argc)
     * args down over our |this| parameter, argv[-1], which is almost always
     * the class constructor object, e.g. Array.  Then call the corresponding
     * prototype native method with our first argument passed as |this|.
     */
    memmove(argv - 1, argv, JS_MAX(fs->nargs + 1U, argc) * sizeof(jsval));

    /*
     * Follow Function.prototype.apply and .call by using the global object as
     * the 'this' param if no args.
     */
    JS_ASSERT(cx->fp->argv == argv);
    tmp = js_ComputeThis(cx, JSVAL_TO_OBJECT(argv[-1]), argv);
    if (!tmp)
        return JS_FALSE;
    cx->fp->thisp = tmp;

    /*
     * Protect against argc - 1 underflowing below. By calling js_ComputeThis,
     * we made it as if the static was called with one parameter.
     */
    if (argc == 0)
        argc = 1;

    return fs->call(cx, JSVAL_TO_OBJECT(argv[-1]), argc - 1, argv, rval);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_GetArrayLength ( JSContext cx,
JSObject obj,
jsuint lengthp 
)

Definition at line 3078 of file jsapi.c.

{
    CHECK_REQUEST(cx);
    return js_GetLengthProperty(cx, obj, lengthp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JS_GetClass ( JSObject obj)

Definition at line 2260 of file jsapi.c.

{
    return LOCKED_OBJ_GET_CLASS(obj);
}

Here is the caller graph for this function:

JS_GetClassObject ( JSContext cx,
JSObject obj,
JSProtoKey  key,
JSObject **  objp 
)

Definition at line 1638 of file jsapi.c.

{
    CHECK_REQUEST(cx);
    return js_GetClassObject(cx, obj, key, objp);
}

Here is the call graph for this function:

JS_GetConstructor ( JSContext cx,
JSObject proto 
)

Definition at line 2365 of file jsapi.c.

{
    jsval cval;

    CHECK_REQUEST(cx);
    if (!OBJ_GET_PROPERTY(cx, proto,
                          ATOM_TO_JSID(cx->runtime->atomState.constructorAtom),
                          &cval)) {
        return NULL;
    }
    if (!VALUE_IS_FUNCTION(cx, cval)) {
        JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_NO_CONSTRUCTOR,
                             OBJ_GET_CLASS(cx, proto)->name);
        return NULL;
    }
    return JSVAL_TO_OBJECT(cval);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 985 of file jsapi.c.

{
    return cx->data;
}

Here is the caller graph for this function:

JS_GetElement ( JSContext cx,
JSObject obj,
jsint  index,
jsval vp 
)

Definition at line 3172 of file jsapi.c.

{
    CHECK_REQUEST(cx);
    return OBJ_GET_PROPERTY(cx, obj, INT_TO_JSID(index), vp);
}

Here is the caller graph for this function:

Definition at line 130 of file jsapi.c.

Here is the caller graph for this function:

Definition at line 2025 of file jsapi.c.

{
    uint8 type = (uint8) (*js_GetGCThingFlags(str) & GCF_TYPEMASK);

    if (type >= GCX_EXTERNAL_STRING)
        return (intN)type;
    JS_ASSERT(type == GCX_STRING || type == GCX_MUTABLE_STRING);
    return -1;
}

Here is the call graph for this function:

Definition at line 3618 of file jsapi.c.

{
    return fun->nargs;
}

Here is the caller graph for this function:

Definition at line 3602 of file jsapi.c.

{
#ifdef MOZILLA_1_8_BRANCH
    uintN flags = fun->flags;

    return JSFUN_DISJOINT_FLAGS(flags) |
           (JSFUN_GETTER_TEST(flags) ? JSFUN_GETTER : 0) |
           (JSFUN_SETTER_TEST(flags) ? JSFUN_SETTER : 0) |
           (JSFUN_BOUND_METHOD_TEST(flags) ? JSFUN_BOUND_METHOD : 0) |
           (JSFUN_HEAVYWEIGHT_TEST(flags) ? JSFUN_HEAVYWEIGHT : 0);
#else
    return fun->flags;
#endif
}

Definition at line 3596 of file jsapi.c.

{
    return fun->atom ? ATOM_TO_STRING(fun->atom) : NULL;
}

Here is the caller graph for this function:

Definition at line 3588 of file jsapi.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3582 of file jsapi.c.

{
    return fun->object;
}

Here is the caller graph for this function:

Definition at line 1114 of file jsapi.c.

{
    return cx->globalObject;
}

Here is the caller graph for this function:

Definition at line 1107 of file jsapi.c.

{
    return "JavaScript-C 1.7.0 2007-10-03";
}

Here is the caller graph for this function:

JS_GetInstancePrivate ( JSContext cx,
JSObject obj,
JSClass clasp,
jsval argv 
)

Definition at line 2313 of file jsapi.c.

{
    if (!JS_InstanceOf(cx, obj, clasp, argv))
        return NULL;
    return JS_GetPrivate(cx, obj);
}

Here is the call graph for this function:

Definition at line 4842 of file jsapi.c.

{
    return cx->localeCallbacks;
}
JS_GetMethod ( JSContext cx,
JSObject obj,
const char *