Search completed in 0.91 seconds.
JS::Value
js
::value is the type of javascript values in the jsapi. a c++ variable of type js
::value represents a value in javascript: a string, number, object (including arrays and functions), boolean, symbol, null, or undefined. js
::value is a class whose internal structure is an implementation detail. embeddings should not rely on observed representation details or upon the size of js
::value. ...
...e is the type of javascript values in the jsapi. a c++ variable of type js
::value represents a value in javascript: a string, number, object (including arrays and functions), boolean, symbol, null, or undefined. js
::value is a class whose internal structure is an implementation detail. embeddings should not rely on observed representation details or upon the size of js
::value. ...
...:value represents a value in javascript: a string, number, object (including arrays and functions), boolean, symbol, null, or undefined. js
::value is a class whose internal structure is an implementation detail. embeddings should not rely on observed representation details or upon the size of js
::value. ...
...And 8 more matches
Index
destructor by calling js_destroyidarray. 24 js::autosaveexceptionstate jsapi reference, reference, référence(2), spidermonkey js::autosaveexceptionstate saves and later restores the current exception state of a given jscontext. 25 js::autovaluearray jsapi reference, reference, référence(2), spidermonkey js::autovaluearray<n> holds a rooted array of js
::value. this is typically used for local variables being passed to function which requires js::handlevaluearray or a pointer to js
::value array. 26 js::autovectorrooter jsapi reference, reference, référence(2), spidermonkey js::autovectorrooter<t> holds a variable-size rooted array of type t. 27 js::booleanvalue jsapi reference, reference, référence(2), spidermonk...
... 28 js::call jsapi reference, reference, spidermonkey js::call calls a specified function, fun, on an object, thisobj. in terms of function execution, the object is treated as this. ...
...caller must either ensure dst has enough space to encode the entire string, or pass the length of the buffer as dstlenp. in which case, the function will encode characters from the string until the buffer is exhausted. does not write the null terminator. 39 js::doublenanvalue jsapi reference, reference, référence(2), spidermonkey js::doublenanvalue returns a value of type js
::value that represents an ieee floating-point quiet not-a-number (nan). 40 js::doublevalue jsapi reference, reference, référence(2), spidermonkey js::doublevalue converts a c floating-point number of type double to js
::value, the type of javascript values. 41 js::evaluate jsapi reference, reference, référence(2), spidermonkey js::evaluate compiles and execut...
...And 13 more matches
WebIDL bindings
a readonly attribute only has a getter and no setter. the getter's name is the name of the attribute...
...a readonly attribute only has a getter and no setter. the getter's name is the name of the attribute with the first letter converted to uppercase. this has get prepended to it if any of these conditions hold: the type of the at...
...st represented by the argument type itself, set to the default value if the argument was not in fact passed in. variadic webidl arguments are treated as a const sequence<>& around the actual argument type. here's a table, see the specific sections below for more details and explanations. ...
...And 10 more matches
GC Rooting Guide
api user. since spidermonkey has a moving gc, it is very important that it knows about each and every pointer to a gc thing in the system. spidermonkey's rooting api tries to make this task as simple as possible. what is a gc thing pointer? "gc thing" is the term used to refer to memory allocated and managed by the spidermonkey garbage collector. the main types of gc thing pointer are: js
::value jsobject* jsstring* jsscript* jsid note that js
::value and jsid can contain pointers internally even though they are not a normal pointer type, hence their inclusion in this list. if you use these types directly, or create classes, structs or arrays that contain them, you must follow the rules set out in this guide. if you do not your program will not work correctly - if it works at all. ...
...::rooted<t> instance behaves exactly as if it were the underlying pointer. js::rooted must be constructed with a jscontext*, and optionally an initial value. there are typedefs available for the main types. ...
...ot free (though it only costs a few cycles). thus, it makes more sense to only root the gc thing once and reuse it through an indirect reference. like a reference, a js::handle is immutable: it can only ever refer to the js::rooted<t> that it was created for. similarly to js::rooted<t>, there are typedefs available for the main types: template class typedef js::handle<js
::value> js::handlevalue js::handle<jsobject*> js::handleobject js::handle<jsstring*> js::handlestring js::handle<jsscript*> js::handlescript js::handle<jsid> js::handleid you should use js::handle<t> for all function parameters taking gc thing pointers (except out-parameters, which are described below). for example, instead of: jsobject * somef...
...And 5 more matches
JSAPI Cookbook
this article shows the jsapi equivalent for a tiny handful of common javascript idioms. note: the foss wiki page contains a few links to other libraries and programs that can make life easier when using spidermonkey and jsapi. basics working with values the basic, undifferentiated value type in the jsapi is js
::value. to query whether a value has a particular type, use a correspondingly named member testing function: // javascript var v = computesomevalue(); var isstring = typeof v === "string"; var isnumber = typeof v === "number"; var isnull = v === null; var isboolean = typeof v === "boolean"; var isobject = typeof v === "object" && v !== null; /* jsapi */ js::rootedvalue v(cx, computesomevalue()); bool isstring = v.isstring(); bool isnumber = v.isnumber(); bool isint32 = v.isint32()...
...: v = js::booleanvalue(false); finding the global object many of these recipes require finding the current global object first. // javascript var global = this; there is a function, js_getglobalforscopechain(cx), that makes a best guess, and sometimes that is the best that can be done. but in a jsnative the correct way to do this is: /* jsapi */ bool mynative(jscontext *cx, unsigned argc, js
::value *vp) { js::callargs args = js::callargsfromvp(argc, vp); jsobject *global = js_getglobalforobject(cx, &args.callee()); ... } defining a function // javascript function justforfun() { return null; } /* jsapi */ bool justforfun(jscontext *cx, unsigned argc, js
::value *vp) { js::callargs args = js::callargsfromvp(argc, vp); args.rval().setnull(); return true; } ... ...
...tion /* jsapi * * suppose the script defines a global javascript * function foo() and we want to call it from c. */ js::rootedvalue r(cx); if (!js_callfunctionname(cx, js_getglobalobject(cx), "foo", 0, null, &r)) return false; calling a js function via a local variable // javascript var r = f(); // where f is a local variable /* jsapi * * suppose f is a local c variable of type js
::value. */ js::autovaluevector args(cx); // empty argument list js::rootedvalue r(cx); if (!js_callfunctionvalue(cx, null, f, args, &r) return false; returning an integer // javascript return 23; /* jsapi * * warning: this only works for integers that fit in 32 bits. * otherwise, convert the number to floating point (see the next example). */ js::callargs args = js::callargsfromvp(argc, v...
...And 5 more matches
JSAPI User Guide
as the global object can call them, just as any web page can call alert. in the environment we have created, the "hello world" script looks like this: system("echo hello world"); jsapi concepts this section aims to fill in the major gaps in the picture of the jsapi presented so far. to do anything useful with spidermonkey, you must read all three sections. ...
...ented so far. to do anything useful with spidermonkey, you must read all three sections. javascript values main article: js
::value javascript is a dynamically typed language: variables and properties do not have a type that is fixed at compile time. how can a statically typed language, like c or c++, in which all variables have types, interact with javascript? the jsapi provides a data type, js
::value (also with a deprecated jsval typedef), which can contain javascript values of any type. a js
::value can be a number, a string, a boolean value, a reference to an object (like an object, array, date, or function), or one of the special values null or undefined. for integers and boolean values, a jsval contains the value itself. in other cases, the jsval is a pointer to an object, string, or numb...
...ipt values of any type. a js
::value can be a number, a string, a boolean value, a reference to an object (like an object, array, date, or function), or one of the special values null or undefined. for integers and boolean values, a jsval contains the value itself. in other cases, the jsval is a pointer to an object, string, or number. warning: like c++ pointers, and unlike javascript vars, a js
::value is not automatically initialized to a safe value, and can become a dangling pointer! a dangling pointer is a pointer that used to point to a valid object, but no longer does because the object no longer exists. using a dangling pointer can crash a c++ program (or worse). in the case of js
::value, the javascript garbage collector recycles objects, strings, and numbers that don't appear to be in u...
...And 5 more matches
JS::Add*Root
s discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 31 register a variable as a member of the garbage collector's root set, to protect anything the root points at from garbage collection. these functions are obsoleted, use js::persistentrooted instead. ...
...s root set, to protect anything the root points at from garbage collection. these functions are obsoleted, use js::persistentrooted instead. ...
... js::persistentrooted instead. ...
...And 2 more matches
JS_GetPositiveInfinityValue
js_getnegativeinfinityvalue returns the corresponding negative infinity. ...
...js_getnegativeinfinityvalue returns the corresponding negative infinity. ...
...js_getnegativeinfinityvalue returns the corresponding negative infinity. ...
...And 2 more matches
JS::CallArgs
this article covers features introduced in spidermonkey 17 helper class encapsulating access to the callee, this value, arguments, and argument count for a function call. syntax js::callargs js::callargsfromvp(unsigned argc, js
::value *vp); name type description args unsigned number of argument. (2nd argument of jsnative) vp js
::value * a pointer to the argument value array. (3nd argument of jsnative) methods methods of js::callargs method description bool requireatleast(jscontext *cx, const char *fnname, unsigned required) returns true if there are at least required arguments passed in. if false, it reports an error message on the context. methods inherited from js::callargsbase method ...
... returns the function being called, as a value. must not be called after rval() has been used! js::handlevalue thisv() const returns the this value passed to the function. this method must not be called when the function is being called as a constructor via new. the value may or may not be an object: it is the individual function's responsibility to box the value if needed. js
::value computethis(jscontext *cx) const returns the this value if this is an object, otherwise calls js_computethis and returns it. bool isconstructing() const returns true if the function is called via new. mutablehandlevalue rval() const returns the currently-set return value. the initial contents of this value are unspecified. once this method has been called, callee()...
...' signatures but won't require invasive changes to the methods' implementations, potentially under time pressure. js::callargs encapsulates access to the callee, this, the function call's arguments, and eventual return value for a function call. the principal way to create a callargs is like so, using js::callargsfromvp: static bool functionreturningargctimesarg0(jscontext *cx, unsigned argc, js
::value *vp) { js::callargs args = js::callargsfromvp(argc, vp); // guard against no arguments or a non-numeric arg0. if (args.length() == 0 || !args[0].isnumber()) { args.rval().setint32(0); return true; } // access to the callee must occur before accessing/setting // the return value. jsobject &callee = rec.callee(); // it's always fine to access thisv...
JS::DoubleNaNValue
this article covers features introduced in spidermonkey 24 create a not-a-number (nan) floating-point number as a value of type js
::value. syntax js
::value js::doublenanvalue() description js::doublenanvalue returns a value of type js
::value that represents an ieee floating-point quiet not-a-number (nan). ...
... this article covers features introduced in spidermonkey 24 create a not-a-number (nan) floating-point number as a value of type js
::value. syntax js
::value js::doublenanvalue() description js::doublenanvalue returns a value of type js
::value that represents an ieee floating-point quiet not-a-number (nan). ...
...covers features introduced in spidermonkey 24 create a not-a-number (nan) floating-point number as a value of type js
::value. syntax js
::value js::doublenanvalue() description js::doublenanvalue returns a value of type js
::value that represents an ieee floating-point quiet not-a-number (nan). ...
JS::Remove*Root
me browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 31 unregister a pointer to a gc thing so that it is no longer a member of the garbage collector's root set. this enables any pointed-at gc thing to be garbage collected as needed. ...
... root set. this enables any pointed-at gc thing to be garbage collected as needed. syntax void removevalueroot(jscontext *cx, js::heap<js
::value> *vp); void removestringroot(jscontext *cx, js::heap<jsstring *> *rp); void removeobjectroot(jscontext *cx, js::heap<jsobject *> *rp); void removescriptroot(jscontext *cx, js::heap<jsscript *> *rp); void removevaluerootrt(jsruntime *rt, js::heap<js
::value> *vp); void removestringrootrt(jsruntime *rt, js::heap<jsstring *> *rp); void removeobjectrootrt(jsruntime *rt, js::heap<jsobject *> *rp); void removescriptrootrt(jsruntime *rt, js::heap<jsscript *> *rp); name type description cx jscontext * the context from which to remove the root. requires request. in a js_threadsafe build, the caller must be in a request on ...
...js::heap<jsobject *> *rp); void removescriptrootrt(jsruntime *rt, js::heap<jsscript *> *rp); name type description cx jscontext * the context from which to remove the root. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. rt jsruntime * the runtime from which to remove the root. vp js::heap<js
::value> address of the js
::value variable to remove from the root set. this must have been passed to one of js::addvalueroot, js::addnamedvalueroot or js::addnamedvaluerootrt. rp js::heap<jsstring *> address of the jsstring * variable to remove from the root set. this must have been passed to either js::addstringroot or js::addnamedstringroot. rp js::heap<jsobject *> add...
JS_GetNaNValue
nan is typically used in javascript as the return value of a numeric operation when an argument is invalid or conversion fails. for example, 0/0 and math.sqrt(-1) both return nan. so do number("xyzzy") and math.sin("frank"). ...
... nan is typically used in javascript as the return value of a numeric operation when an argument is invalid or conversion fails. for example, 0/0 and math.sqrt(-1) both return nan. so do number("xyzzy") and math.sin("frank"). ...
... and math.sin("frank"). ...
JS_GetReservedSlot
access an object's reserved slots. syntax // added in spidermonkey 42 js
::value js_getreservedslot(jsobject *obj, uint32_t index); void js_setreservedslot(jsobject *obj, uint32_t index, js
::value v); // obsolete since spidermonkey 42 jsval js_getreservedslot(jsobject *obj, uint32_t index); void js_setreservedslot(jsobject *obj, uint32_t index, jsval v); name type description obj jsobject * an object that has reserved slots. index uint32_t index of the reserved slot to access. v js
::value (in js_setreservedslot) the value to store. description if a jsclass has jsclass_has_reserved_slots(n) in its flags, with n > 0, or has a non-null jsclass.reserveslots callback, then objects of that class have n reserved slots in which ...
... reserved slots may also contain private values to store pointer values (whose lowest bit is 0) or uint32_t, when non-javascript values must be stored; the garbage collector ignores such values when it sees them. ...
...t not be exposed directly to javascript. it's only legal to store and retrieve data from private values. they cannot be returned from functions, set as properties on objects, embedded in javascript arrays, and so on.) new objects' reserved slots are initialized to undefined. see also mxr id search for js_getreservedslot mxr id search for js_setreservedslot bug 1184564 -- changed jsval to js
::value ...
JS_NumberValue
this article covers features introduced in spidermonkey 17 convert a c floating-point number of type double to a js
::value. replacement to js_newnumbervalue, js_newdoublevalue, js_newdouble. syntax // added in spidermonkey 42 js
::value js_numbervalue(double d); // obsolete since spidermonkey 42 jsval js_numbervalue(double d); name type description d double the numeric value to convert. description js_numbervalue converts a c floating-point number of type double to js
::value, the type of javascript values. the result is an integer js
::value if d can be stored that way. ...
...double d); // obsolete since spidermonkey 42 jsval js_numbervalue(double d); name type description d double the numeric value to convert. ...
...ion d double the numeric value to convert. description js_numbervalue converts a c floating-point number of type double to js
::value, the type of javascript values. the result is an integer js
::value if d can be stored that way. ...
JS_SameValue
rict equality (===) in that +0 and -0 are not the same and in that nan is the same as nan. the samevalue algorithm is equivalent to the following javascript: function samevalue(v1, v2) { if (v1 === 0 && v2 === 0) return 1 / v1 === 1 / v2; if (v1 !== v1 && v2 !== v2) return true; return v1 === v2; } syntax // added in spidermonkey 45 bool js_samevalue(jscontext *cx, js::handle<js
::value> v1, js::handle<js
::value> v2, bool *same); // obsolete since jsapi 39 bool js_samevalue(jscontext *cx, jsval v1, jsval v2, bool *same); name type description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v1 js...
... description js_samevalue determines whether two values are the same, returning true or false accordingly. this method is infallible. ...
... bool js_samevalue(jscontext *cx, jsval v1, jsval v2, bool *same); name type description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v1 js::handle<js
::value> / jsval the first value. v2 js::handle<js
::value> / jsval the second value. description js_samevalue determines whether two values are the same, returning true or false accordingly. this method is infallible. see also mxr id search for js_samevalue js_strictlyequal js_looselyequal bug 1132045 -- use handle ...
JSAPI reference
hrowstopiteration added in spidermonkey 1.8 js_isstopiteration added in spidermonkey 31 typedef jsexceptionstate js_saveexceptionstate js_restoreexceptionstate js_dropexceptionstate these functions translate errors into exceptions and vice versa: js_reportpendingexception js_errorfromexception js_throwreportederror obsolete since jsapi 29 values and types typedef jsval js
::value js
::value constructors: js::nullvalue added in spidermonkey 24 js::undefinedvalue added in spidermonkey 24 js::booleanvalue added in spidermonkey 24 js::truevalue added in spidermonkey 24 js::falsevalue added in spidermonkey 24 js::numbervalue added in spidermonkey 24 js::int32value added in spidermonkey 24 js::doublevalue added in spidermonkey 24 js::float32value added in spidermonk...
...dermonkey 24 js::falsevalue added in spidermonkey 24 js::numbervalue added in spidermonkey 24 js::int32value added in spidermonkey 24 js::doublevalue added in spidermonkey 24 js::float32value added in spidermonkey 24 js::stringvalue added in spidermonkey 24 js::objectvalue added in spidermonkey 24 js::objectornullvalue added in spidermonkey 24 js::symbolvalue added in spidermonkey 38 js
::value constants: js::nullhandlevalue added in spidermonkey 24 js::undefinedhandlevalue added in spidermonkey 24 js::truehandlevalue added in spidermonkey 38 js::falsehandlevalue added in spidermonkey 38 jsval constants: jsval_null obsolete since jsapi 42 jsval_void obsolete since jsapi 42 jsval_true obsolete since jsapi 42 jsval_false obsolete since jsapi 42 jsval_zero obsolete since jsa...
...value added in spidermonkey 38 jsval constants: jsval_null obsolete since jsapi 42 jsval_void obsolete since jsapi 42 jsval_true obsolete since jsapi 42 jsval_false obsolete since jsapi 42 jsval_zero obsolete since jsapi 42 jsval_one obsolete since jsapi 42 function and macros for checking the type of a jsval: enum jstype js_typeofvalue all of the following are deprecated. see js
::value for their modern replacements. jsval_is_null obsolete since jsapi 32 jsval_is_void obsolete since jsapi 32 jsval_is_boolean obsolete since jsapi 32 jsval_is_number obsolete since jsapi 32 jsval_is_int obsolete since jsapi 32 jsval_is_double obsolete since jsapi 32 jsval_is_string obsolete since jsapi 32 jsval_is_object obsolete since jsapi 15 jsval_is_primitive obsolete since jsapi 32 ...
Hacking Tips
ermonkey unwinder is disabled by default, to enable it type: enable unwinder .* spidermonkey (gdb) b js::math_cos (gdb) run […] #0 js::math_cos (cx=0x14f2640, argc=1, vp=0x7fffffff6a88) at js/src/jsmath.cpp:338 338 callargs args = callargsfromvp(argc, vp); (gdb) enable unwinder .* spidermonkey (gdb) backtrace 10 #0 0x0000000000f89979 in js::math_cos(jscontext*, unsigned int, js
::value*) (cx=0x14f2640, argc=1, vp=0x7fffffff6a88) at js/src/jsmath.cpp:338 #1 0x0000000000ca9c6e in js::calljsnative(jscontext*, bool (*)(jscontext*, unsigned int, js
::value*), js::callargs const&) (cx=0x14f2640, native=0xf89960 , args=...) at js/src/jscntxtinlines.h:235 #2 0x0000000000c87625 in js::invoke(jscontext*, js::callargs const&, js::maybeconstruct) (cx=0x14f2640, args=..., construct=js::no_...
...), js::callargs const&) (cx=0x14f2640, native=0xf89960 , args=...) at js/src/jscntxtinlines.h:235 #2 0x0000000000c87625 in js::invoke(jscontext*, js::callargs const&, js::maybeconstruct) (cx=0x14f2640, args=..., construct=js::no_construct) at js/src/vm/interpreter.cpp:476 #3 0x000000000069bdcf in js::jit::docallfallback(jscontext*, js::jit::baselineframe*, js::jit::iccall_fallback*, uint32_t, js
::value*, js::mutablehandlevalue) (cx=0x14f2640, frame=0x7fffffff6ad8, stub_=0x1798838, argc=1, vp=0x7fffffff6a88, res=jsval_void) at js/src/jit/baselineic.cpp:6113 #4 0x00007ffff7f41395 in <<jitframe_exit>> () #5 0x00007ffff7f42223 in <<jitframe_baselinestub>> () #6 0x00007ffff7f4423d in <<jitframe_baselinejs>> () #7 0x00007ffff7f4222e in <<jitframe_baselinestub>> () #8 0x00007ffff7f4326a in <<jitf...
SpiderMonkey Internals
in addition to the interpreter, spidermonkey contains a just-in-time (jit) compiler, a garbage collector, code implementing the basic behavior of javascript values, a standard library implementing ecma 262-5.1 §15 with various extensions, and a few public apis. ...
... maxbytes (as passed to js_newruntime) bytes of gc things have been allocated and another thing-allocation request is made. js api users should call js_gc or js_maybegc between script executions or from the operation callback, as often as necessary. because the gc is exact, c/c++ applications must ensure that all live objects, strings, and numbers are gc-reachable. javascript values the type js
::value represents a javascript value. the representation is 64 bits and uses nan-boxing on all platforms, although the exact nan-boxing format depends on the platform. nan-boxing is a technique based on the fact that in ieee-754 there are 2**53-2 different bit patterns that all represent nan. hence, we can encode any floating-point value as a c++ double (noting that javascript nan must be represented a...
JS::AutoValueArray
this article covers features introduced in spidermonkey 31 root an internal fixed-size array of js
::values. syntax js::autovaluearray<n> vp(cx); name type description cx jscontext * the context in which to add the root. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. n size_t size of a js
::value array. description js::autovaluearray<n> holds a rooted array of js
::value. this is typically used for local variables being passed to function which requires js::handlevaluearray or a pointer to js
::value array. examples pass to function as a pointer to js
::value. bool somefunction1(jscontext *cx, unsigned argc, const js
::value *argv) { /* ... */ } js::autovaluearray<2> args(cx); /* ...
...aluearray<2> args(cx); /* ... ...
JS::BooleanValue
this article covers features introduced in spidermonkey 24 convert a c boolean of type bool to a js
::value. syntax js
::value js::booleanvalue(bool boo) name type description boo bool c bool to convert. description js::booleanvalue converts a c boolean of type bool to js
::value, the type of javascript values. ...
...ticle covers features introduced in spidermonkey 24 convert a c boolean of type bool to a js
::value. syntax js
::value js::booleanvalue(bool boo) name type description boo bool c bool to convert. description js::booleanvalue converts a c boolean of type bool to js
::value, the type of javascript values. ...
JS::DoubleValue
this article covers features introduced in spidermonkey 24 convert a c floating-point number of type double to a js
::value. syntax js
::value js::doublevalue(double dbl) name type description dbl double c double to convert. description js::doublevalue converts a c floating-point number of type double to js
::value, the type of javascript values. the result is an floating-point js
::value. ...
...nt number of type double to a js
::value. syntax js
::value js::doublevalue(double dbl) name type description dbl double c double to convert. description js::doublevalue converts a c floating-point number of type double to js
::value, the type of javascript values. the result is an floating-point js
::value. ...
JS::FalseValue
this article covers features introduced in spidermonkey 24 create a js
::value that represents the javascript value false. syntax js
::value js::falsevalue() description js::falsevalue creates a js
::value that represents the javascript value false. ...
... this article covers features introduced in spidermonkey 24 create a js
::value that represents the javascript value false. syntax js
::value js::falsevalue() description js::falsevalue creates a js
::value that represents the javascript value false. ...
JS::Float32Value
this article covers features introduced in spidermonkey 24 convert a c floating-point number of type float to a js
::value. syntax js
::value js::float32value(float f) name type description f float c float to convert. description js::float32value converts a c floating-point number of type float to js
::value, the type of javascript values. the result is an floating-point js
::value. ...
...ng-point number of type float to a js
::value. syntax js
::value js::float32value(float f) name type description f float c float to convert. description js::float32value converts a c floating-point number of type float to js
::value, the type of javascript values. the result is an floating-point js
::value. ...
JS::HandleValueArray
this article covers features introduced in spidermonkey 31 a handle to an array of rooted values. syntax js::handlevaluearray(const js::rootedvalue& value); js::handlevaluearray(const js::autovaluevector& values); js::handlevaluearray(const js::autovaluearray<n>& values); js::handlevaluearray(const js::callargs& args); js::handlevaluearray::frommarkedlocation(size_t len, const js
::value *elements); js::handlevaluearray::subarray(const js::handlevaluearray& values, size_t startindex, size_t len); js::handlevaluearray::empty(); name type description value js::rootedvalue & an element of newly created 1-length array. values js::autovaluevector & elements of newly created array. values js::a...
...ength array. values js::autovaluevector & elements of newly created array. values js::autovaluearray & elements of newly created array. args js::callargs & elements of newly created array. len size_t (frommarkedlocation only) length of elements array or (subarray only) length of sub array of values. elements js
::value * (frommarkedlocation only) a pointer to the first element of an array of js
::value. values js::handlevaluearray (subarray only) an array to get sub array. startindex size_t (subarray only) an index of the first element of subarray of values. methods method description size_t length() const returns the length of the array. ...
JS::Int32Value
this article covers features introduced in spidermonkey 24 convert a c signed 32-bit integer of type int32_t to a js
::value. syntax js
::value js::int32value(int32_t i32) name type description i32 int32_t c integer to convert. description js::int32value converts a c signed 32-bit integer of type int32_t to js
::value, the type of javascript values. the result is an integer js
::value. ...
...32-bit integer of type int32_t to a js
::value. syntax js
::value js::int32value(int32_t i32) name type description i32 int32_t c integer to convert. description js::int32value converts a c signed 32-bit integer of type int32_t to js
::value, the type of javascript values. the result is an integer js
::value. ...
JS::NullValue
this article covers features introduced in spidermonkey 24 create a js
::value that represents the javascript value null. syntax js
::value js::nullvalue(); description js::nullvalue creates a js
::value that represents the javascript value null. ...
... this article covers features introduced in spidermonkey 24 create a js
::value that represents the javascript value null. syntax js
::value js::nullvalue(); description js::nullvalue creates a js
::value that represents the javascript value null. ...
JS::NumberValue
this article covers features introduced in spidermonkey 24 convert a c integer or floating-point value to a js
::value. syntax js
::value js::numbervalue(float f) js
::value js::numbervalue(double dbl) js
::value js::numbervalue(int8_t i) js
::value js::numbervalue(uint8_t i) js
::value js::numbervalue(int16_t i) js
::value js::numbervalue(uint16_t i) js
::value js::numbervalue(int32_t i) js
::value js::numbervalue(uint32_t i) name type description f or dbl or i any c integer or floating-point value to convert. description js::numbervalue converts a c integer or floating-point value to js
::value, the type of javascript values. ...
... js::numbervalue(uint16_t i) js
::value js::numbervalue(int32_t i) js
::value js::numbervalue(uint32_t i) name type description f or dbl or i any c integer or floating-point value to convert. description js::numbervalue converts a c integer or floating-point value to js
::value, the type of javascript values. ...
JS::ObjectOrNullValue
this article covers features introduced in spidermonkey 24 convert a jsobject or null pointer to a js
::value. syntax js
::value js::objectornullvalue(jsobject* obj) name type description str jsobject* a pointer to a jsobject or null to convert. description js::objectvalue converts a given jsobject to js
::value. if the pointer is null, it returns javascript null. ...
...o a js
::value. syntax js
::value js::objectornullvalue(jsobject* obj) name type description str jsobject* a pointer to a jsobject or null to convert. description js::objectvalue converts a given jsobject to js
::value. if the pointer is null, it returns javascript null. the conversion always succeeds. ...
JS::ObjectValue
this article covers features introduced in spidermonkey 24 convert a jsobject to a js
::value. syntax js
::value js::objectvalue(jsobject& obj) name type description str jsobject& a reference to a jsobject to convert. description js::objectvalue converts a given jsobject to js
::value. the conversion always succeeds. ...
...ers features introduced in spidermonkey 24 convert a jsobject to a js
::value. syntax js
::value js::objectvalue(jsobject& obj) name type description str jsobject& a reference to a jsobject to convert. description js::objectvalue converts a given jsobject to js
::value. the conversion always succeeds. ...
JS::PersistentRooted
alue itself cannot be a global variable. mozilla::maybe<js::persistentrootedvalue> persistentval; // you can also declare it just as a pointer, instead of using maybe. // js::persistentrootedvalue* persistentval; // [spidermonkey 38] js::persistentrootedvalue itself can be a global variable. ...
...; static bool setpersistent(jscontext* cx, unsigned argc, js
::value* vp) { js::callargs args = callargsfromvp(argc, vp); // set persistent value. persistentval.ref() = args.get(0); // or // *persistentval = args.get(0); // [spidermonkey 38] // persistentval = args.get(0); args.rval().setundefined(); return true; } static bool getpersistent(jscontext* cx, unsigned argc, js
::value* vp) { js::callargs args = callargsfromvp(argc, vp); // get persistent value. js::rootedvalue val(cx, persistentval.ref()); // or // js::rootedvalue val(cx, *persistentval); // [spidermonkey 38] // js::rootedvalue val(cx, persistentval); args.rval().set(val); return true; } static const jsfunctionspec functions[] = { js_fn("getpersistent", getpersistent, 1, 0), js_fn(...
JS::StringValue
this article covers features introduced in spidermonkey 24 convert a jsstring to a js
::value. syntax js
::value js::stringvalue(jsstring* str) name type description str jsstring* a pointer to a jsstring to convert. description js::stringvalue converts a given jsstring to js
::value. ...
...le covers features introduced in spidermonkey 24 convert a jsstring to a js
::value. syntax js
::value js::stringvalue(jsstring* str) name type description str jsstring* a pointer to a jsstring to convert. description js::stringvalue converts a given jsstring to js
::value. the conversion always succeeds. ...
JS::SymbolValue
this article covers features introduced in spidermonkey 38 convert a js::symbol to a js
::value. syntax js
::value js::symbolvalue(js::symbol* sym) name type description sym js::symbol* a pointer to a js::symbol to convert. description js::symbolvalue converts a given js::symbol to js
::value. ...
...features introduced in spidermonkey 38 convert a js::symbol to a js
::value. syntax js
::value js::symbolvalue(js::symbol* sym) name type description sym js::symbol* a pointer to a js::symbol to convert. description js::symbolvalue converts a given js::symbol to js
::value. the conversion always succeeds. ...
JS::TrueValue
this article covers features introduced in spidermonkey 24 create a js
::value that represents the javascript value true. syntax js
::value js::truevalue() description js::truevalue creates a js
::value that represents the javascript value true. ...
... this article covers features introduced in spidermonkey 24 create a js
::value that represents the javascript value true. syntax js
::value js::truevalue() description js::truevalue creates a js
::value that represents the javascript value true. ...
JS::UndefinedValue
this article covers features introduced in spidermonkey 24 create a js
::value that represents the javascript value undefined. syntax js
::value js::undefinedvalue(); description js::undefinedvalue creates a js
::value that represents the javascript value undefined. ...
... this article covers features introduced in spidermonkey 24 create a js
::value that represents the javascript value undefined. syntax js
::value js::undefinedvalue(); description js::undefinedvalue creates a js
::value that represents the javascript value undefined. ...
JSNative
jsnative is the type of many jsapi callbacks. in particular, apis such as js_initclass and js_definefunctions create custom methods on javascript objects that are implemented as jsnative callbacks provided by the application, written in c/c++ code. the term "native" here refers to c/c++ code as opposed to javascript code. syntax typedef bool (* jsnative)(jscontext *cx, unsigned argc, js
::value *vp); name type description cx jscontext * the context in which the native function is being called. provides request. in js_threadsafe builds, the javascript engine calls this callback only from within an active request on cx. the callback does not need to call js_beginrequest()). argc unsigned the number of arguments supplied to the function by the cal...
...led. provides request. in js_threadsafe builds, the javascript engine calls this callback only from within an active request on cx. the callback does not need to call js_beginrequest()). argc unsigned the number of arguments supplied to the function by the caller (as opposed to, say, the number of arguments the function is specified to take in its jsfunctionspec). vp js
::value * the arguments, the this argument, the return-value slot, and the callee function object are accessible through this pointer using macros described below. description jsnative is the type of native implementations of javascript functions. full documentation of how to define a jsnative (or a jsfastnative, the equivalent typedef which preceded it) is available in the api header "js/cal...
JS_DefaultValue
removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 1.8.6 converts a javascript object to a primitive value, using the semantics of that object's internal [[defaultvalue]] hook. renamed to js::toprimitive from jsapi 44. syntax bool js_defaultvalue(jscontext *cx, js::handle<jsobject*> obj, jstype hint, js::mutablehandle<js
::value> vp); name type description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handle<jsobject*> the object to convert. hint jstype the hint to pass to the [[defaultvalue]] hook when converting the object. hint must ...
...ller must be in a request on this jscontext. obj js::handle<jsobject*> the object to convert. hint jstype the hint to pass to the [[defaultvalue]] hook when converting the object. hint must be jstype_string or jstype_number to pass the corresponding type as a hint, or jstype_void to pass no hint. do not pass any other type. vp js::mutablehandle<js
::value> out parameter. on success, *vp receives the converted value. description js_defaultvalue converts a javascript object, obj, to a primitive value using that object's [[defaultvalue]] hook. ecmascript specifies that all objects have a [[defaultvalue]] hook. objects with classes defined by ecmascript itself all use the [[defaultvalue]] algorithm specified in §8.12.8 (but note the alg...
JS_DumpHeap
gctracekind kind, void *thingtofind, size_t maxdepth, void *thingtoignore); name type description cx jscontext * pointer to a js context. every jscontext is permanently associated with a jsruntime; each jsruntime contains a gc heap. fp file * file for the dump output. startthing void * null or a pointer to a gc thing (use js
::value::togcthing() to obtain a pointer to pass here). when null, dump all things reachable from the runtime roots. when non-null, dump only things reachable from the object indicated. startkind jsgctracekind trace kind of startthing, if startthing is not null. must be jstrace_object when startthing is null. thingtofind void * null or a pointer to a gc thing. if this is non...
...or detail. when tracing a thing, the gc needs to know about the layout of the object it is looking at. there are a fixed number of different layouts that the gc knows about. the "trace kind" is a static map which tells which layout a gc thing has. although this map is public, the details are completely hidden. not all of the matching c++ types are exposed, and those that are, are opaque. see js
::value::gckind() and jstracecallback in <codde>tracer.h</codde> for more details. see also bug 378261 bug 1122842 ...
JS_GetEmptyStringValue
get the empty string as a value of type js
::value. syntax // added in spidermonkey 42 js
::value js_getemptystringvalue(jscontext *cx); // obsolete since spidermonkey 42 jsval js_getemptystringvalue(jscontext *cx); name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. description js_getemptystringvalue returns the empty string as a js
::value. ...
...key 42 jsval js_getemptystringvalue(jscontext *cx); name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. description js_getemptystringvalue returns the empty string as a js
::value. see also mxr id search for js_getemptystringvalue bug 1184564 -- changed jsval to js
::value ...
JS_HasInstance
bp bool * out parameter. on success, *bp receives the result of the test. ...
... bp bool * out parameter. on success, *bp receives the result of the test. description js_hasinstance determines if a specified js value, v, is an instance of js object, obj. this function is equivalent to v instanceof obj test in javascript. ...
JS_IdToValue
on success, *vp receives the converted value. description js_idtovalue converts a specified js id, id, to a js value. on success, js_idtovalue stores the converted value in *vp and returns true. ...
...on success, *vp receives the converted value. description js_idtovalue converts a specified js id, id, to a js value. on success, js_idtovalue stores the converted value in *vp and returns true. otherwise it returns false. the inverse of js_idtovalue is js_valuetoid. ...
JS_IsStopIteration
this article covers features introduced in spidermonkey 31 determine whether the value is a stopiteration exception or not. syntax // added in spidermonkey 42 bool js_isstopiteration(js
::value v); // obsolete since spidermonkey 42 bool js_isstopiteration(jsval v); name type description v js
::value the value to check. ...
...js_isstopiteration(js
::value v); // obsolete since spidermonkey 42 bool js_isstopiteration(jsval v); name type description v js
::value the value to check. description js_isstopiteration returns true if v is stopiteration, otherwise false. ...
JS_TypeOfValue
description js_typeofvalue examines a specified js value, v, and returns its js data type. the return value is always one of jstype_void, jstype_object, jstype_function, jstype_string, jstype_number, or jstype_boolean. ...
... description js_typeofvalue examines a specified js value, v, and returns its js data type. the return value is always one of jstype_void, jstype_object, jstype_function, jstype_string, jstype_number, or jstype_boolean. ...
JS_ValueToId
syntax bool js_valuetoid(jscontext *cx, js::handlevalue v, js::mutablehandleid idp); bool js_stringtoid(jscontext *cx, js::handlestring s, js::mutablehandleid idp); // added in spidermonkey 38 bool js_indextoid(jscontext *cx, uint32_t index, js::mutablehandleid idp); // added in spidermonkey 17 bool js_charstoid(jscontext* cx, js::twobytechars chars, js::mutablehandleid idp); // added in spidermonkey 24 void js::protokeytoid(jscontext *cx, jsprotokey key, js::mutablehandleid idp); // added in spidermonkey 38 name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the js value to convert. ...
...js::handlestring the js string to convert. index uint32_t an unsigned integer index of array to convert. chars js::twobytechars the string to convert. key jsprotokey the prototype key to convert. idp js::mutablehandleid out parameter. on success, *idp receives the converted jsid. description js_valuetoid converts a specified js
::value, v, to a jsid. if v is an integer, *idp receives an integer jsid. otherwise, if e4x support is enabled and v is an object, *idp receives an object jsid. otherwise, *idp receives an interned string jsid based on the value of v. if v is not a string, it is converted to a string as if by calling js_valuetostring. js_stringtoid and js_charstoid convert a specified string to a jsid. js_indextoid con...
JS_ValueToSource
description js_valuetosource converts a specified javascript value, v, to a javascript source. on success, js_valuetosource returns a pointer to a string. on error or exception, it returns null. this happens, for example, if v is an object and v.tosource() throws an exception. ...
... description js_valuetosource converts a specified javascript value, v, to a javascript source. on success, js_valuetosource returns a pointer to a string. on error or exception, it returns null. this happens, for example, if v is an object and v.tosource() throws an exception. ...
CSS3 - Archive of obsolete content
using the css box-sizing property. at risk: due to insufficient browser support, standardization of the padding-box value may be postponed to the next iteration of this module. allow the styling of forms according their content using the css :indeterminate, :default, :valid, :invalid, :in-range, :out-of-range, :required, :optional, :read-only, and :read-write pseudo-classes and the
::value, ::choices, ::repeat-item, and ::repeat-index pseudo-elements. at risk: due to insufficient browser support, standardization of the pseudo-elements
::value, ::choices, ::repeat-item, and ::repeat-index may be postponed to the next iteration of this module . support for icons, defined by the css icon property simultaneously with the new icon value of the css content property. at ...
Implementation Status - Archive of obsolete content
11 integration with soap supported g. xforms and styling section title status notes bugs g.1 pseudo-classes partial :read-only and :read-write are suported using :-moz-read-only and :-moz-read-write 313111; g.2 pseudo-elements unsupported we support
::value, ::repeat-index, and ::repeat-item through the attributes xf-value, xf-repeat-index, and xf-repeat-item. 271724; ...
Mozilla XForms Specials - Archive of obsolete content
m the same limitation. pseudo-class support we currently support all the css pseudo-classes in xforms (:enabled, :disabled, etc. ), except for :read-only and :read-write, because of non-specified behaviour of these for (x)html. instead you have to use :-moz-read-only and :-moz-read-write for now. (limitation tracked in bug 313111)pseudo element support there is no support for the pseudo elements (
::value, ::repeat-item, and ::repeat-index ). instead you will have to use the following normal classes instead: xf-value xf-repeat-item xf-repeat-index for example, to target the value element of an input control use: @namespace xf url("http://www.w3.org/2002/xforms"); xf|input .xf-value { ... } the pseudo elements are defined in the css3 basic user interface specification . (limitation tracked in ...
BOOLEAN_TO_JSVAL
please use js::booleanvalue/js::truevalue/js::falsevalue instead in spidermonkey 45 or later. syntax jsval boolean_to_jsval(bool b); name type description b bool c integer value to be converted to a boolean jsval. ...
DOUBLE_TO_JSVAL
me. try to avoid using it. casts a pointer to a gc-allocated jsdouble to type jsval. please use js::doublevalue instead in spidermonkey 45 or later. syntax jsval double_to_jsval(double d); name type description d double c double to convert to a jsval. description double_to_jsval is the inverse of js::tonumber. to convert a c float, double to type js
::value, use js_numbervalue instead. see also mxr id search for double_to_jsval js::tonumber js_numbervalue js::doublevalue bug 1177892 -- removed ...
JS::AutoVectorRooter
utovectorrooter<jsfunction *> js::autoscriptvector autovectorrooter<jsscript *> see also mxr id search for js::autovectorrooter mxr id search for js::autovaluevector mxr id search for js::autoidvector mxr id search for js::autoobjectvector mxr id search for js::autofunctionvector mxr id search for js::autoscriptvector js::autovaluearray<n> - fixed-size array of js
::value bug 677079 bug 868580 - expose js::autoobjectvector bug 848592 - added js::autofunctionvector bug 676281 - added js::autoscriptvector ...
JS::NullHandleValue
syntax const js::handlevalue js::nullhandlevalue; description js::nullhandlevalue is a js::handlevalue constant that represents the javascript value null. ...
JS::TrueHandleValue
syntax const js::handlevalue js::truehandlevalue; const js::handlevalue js::falsehandlevalue; description js::truehandlevalue and js::falsehandlevalue are js::handlevalue constants that represent the javascript values true and false. ...
JS::UndefinedHandleValue
syntax const js::handlevalue js::undefinedhandlevalue; description js::undefinedhandlevalue is a js::handlevalue constant that represents the javascript value undefined. ...
JSPropertyOp
object whose properties are being accessed. id js::handleid the name or index of the property being accessed. this is either a string (unicode property identifier) or an integer (element index). strict bool (jsstrictpropertyop only) if strict is true, treating the assignment as strict mode code. vp js::mutablehandlevalue in/out parameter. points to a js
::value variable. the meaning of this variable is different for each of the hooks; see below. description jspropertyop and jsstrictpropertyop callbacks are hooks that applications may install to be called at some point during property access. a jspropertyop may be installed on an individual property as a getter or setter; or it may be installed on a jsclass to hook property gets, sets, or adds. t...
JS_DefineElement
erty method for retrieving the current property value. setter jsnative or jsstrictpropertyop setproperty method for specifying a new property value. flags unsigned property attributes. obsolete since jsapi 32 description js_defineelement defines a numeric property for a specified object, obj. index is the index of the element being defined. value is one of js
::value, jsobject, jsstring, int32_t, uint32_t, or double that defines the property's initial value. getter and setter identify the getproperty and setproperty methods for the property, respectively. if you pass null values for these entries, js_defineelement assigns the default getproperty and setproperty methods to this element. obsolete since jsapi 32 flags contains the property attributes to set fo...
JS_GetPropertyDefault
y still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 1.8.5 finds a specified property and retrieves its value or provided default value. syntax bool js_getpropertydefault(jscontext *cx, jsobject *obj, const char *name, jsval def, js::mutablehandle<js
::value> vp); bool js_getpropertybyiddefault(jscontext *cx, jsobject *obj, jsid id, jsval def, js::mutablehandle<js
::value> vp); name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object to search on for the property. ...
JS_LooselyEqual
this article covers features introduced in spidermonkey 1.8.1 determine whether two javascript values are equal in the sense of the == operator. syntax bool js_looselyequal(jscontext *cx, js::handle<js
::value> v1, js::handle<js
::value> v2, bool *equal); name type description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v1, v2 js::handle<js
::value> the value to compare. equal bool * out parameter. receives the comparison result. description js_looselyequal determines if v1 is loosely equal to v2 under the javascript == operator, as specified in ecma 262-3 §11.9.3. if ...
JS_StrictlyEqual
this article covers features introduced in spidermonkey 1.8.1 determine whether two javascript values are equal in the sense of the === operator. syntax // added in spidermonkey 45 bool js_strictlyequal(jscontext *cx, js::handle<js
::value> v1, js::handle<js
::value> v2, bool *equal); // obsolete since jsapi 39 bool js_strictlyequal(jscontext *cx, jsval v1, jsval v2, bool *equal); name type description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v1, v2 js::handle<js
::value> / jsval the value to compare. equal bool * out parameter. receives the comparison result. description js_st...
JS_ValueToFunction
syntax jsfunction * js_valuetofunction(jscontext *cx, js::handlevalue v); jsfunction * js_valuetoconstructor(jscontext *cx, js::handlevalue v); name type description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert. description js_valuetofunction converts a specified javascript value, v, to a function. js_valuetoconstructor is the exactly same function as js_valuetofunction. ...
Property attributes
flag only valid when defining over an existing property. added in spidermonkey 38 mxr id search for jsprop_ignore_readonly jsprop_ignore_permanent ignore the value in jsprop_permanent. this flag only valid when defining over an existing property. added in spidermonkey 38 mxr id search for jsprop_ignore_permanent jsprop_ignore_value ignore the js
::value in the descriptor. nothing was specified when passed to object.defineproperty from script. added in spidermonkey 38 mxr id search for jsprop_ignore_value see also bug 575997 - for jsprop_shared bug 1088002 - added jsprop_propop_accessors bug 825199 - added jsprop_define_late bug 365851 - added jsfun_stub_gsops bug 581263 - added jsfun_constructor bug 1101123 - added jsprop...
jsid
also, there is an additional jsid value, jsid_void, which does not occur in js scripts but may be used to indicate the absence of a valid jsid. a void jsid is not a valid id and only arises as an exceptional api return value, such as in js_nextproperty. ...
SpiderMonkey 31
has completed, the corresponding js_shutdown method (currently non-mandatory, but highly recommended as it may become mandatory in the future) uninitializes spidermonkey, cleaning up memory and allocations performed by js_init. a major change to spidermonkey in 31 is that its apis support a moving garbage collector. this entailed changing the vast majority of the jsapi from raw types, such as js
::value or js
::value*, to js::handle and js::mutablehandle template types that encapsulate access to the provided value/string/object or its location. the js::handle<js
::value> and js::mutablehandle<js
::value> classes have been specialized to implement the same interface as js
::value, for simplicity and to ease migration pain. changes to introduce handles to the jsapi are not individually documented, b...
SpiderMonkey 38
the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 38 .... xxx will need updating for actual new gc stuff at time! a major change to spidermonkey in 38 is that its apis support a moving garbage collector. this entailed changing the vast majority of the jsapi from raw types, such as js
::value or js
::value*, to js::handle and js::mutablehandle template types that encapsulate access to the provided value/string/object or its location. the js::handle<js
::value> and js::mutablehandle<js
::value> classes have been specialized to implement the same interface as js
::value, for simplicity and to ease migration pain. changes to introduce handles to the jsapi are not individually documented, b...
Interfacing with the XPCOM cycle collector
_callback(msomeobj) ns_impl_cycle_collection_trace_end note that if your class is a wrapper cache then you likely have generate code that uses ns_impl_cycle_collection_wrappercache_# macro instead of ns_impl_cycle_collection_#. unfortunately this macro defines the trace method and so you can't list your js object; hence, you need to also manually implmenet trace and unlink as above. handling js
::value fields recall (or see here) that a js
::value may reference a string or object and is subject to gc. hence, we need to tell the cycle collector about any such member variables. this is the same as for the jsobject case, but using the ns_impl_cycle_collection_trace_jsval_member_callback macro: ns_impl_cycle_collection_trace_begin(nsfoo) ... ns_impl_cycle_collection_trace_jsval_member_callback...