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

Stored value

In the JSAPI, the stored value of an object property is its last known value. For a data property, this is exactly the same thing as the property's current value.

The JavaScript engine sets aside a field of type jsval for the stored value of most object properties, even properties that have getters. The stored value is updated each time the program gets or sets the property. The new stored value is the result of getting or setting the property, after the getter or setter, if any, is called.

JS_DefineProperty allows the application to specify a property's initial stored value.

JS_LookupProperty fetches a property's stored value without triggering its getter.

Properties with the JSPROP_SHARED attribute do not have a stored value. ES5 accessor properties, as in {get length() { return 0; }, automatically have JSPROP_SHARED.

Properties of objects that have custom JSObjectOps do not have a stored value.

Stored values are strong references for the purpose of garbage collection. As long as an object is reachable, the stored values of its properties are reachable and will not be collected.

Document Tags and Contributors

 Contributors to this page: fscholz, Jorend
 Last updated by: fscholz,