pub struct ObjectData {
pub proto: Option<Gc<JsObject>>,
pub props: Vec<(PropertyKey, Property)>,
pub kind: ObjectKind,
pub extensible: bool,
pub elements_writable: bool,
pub home_object: Option<Gc<JsObject>>,
pub class_constructor: bool,
}Expand description
An object’s mutable state: its prototype, property table and internal slots.
Fields§
§proto: Option<Gc<JsObject>>The prototype, or None for Object.prototype and for a null-prototype
object created with Object.create(null).
props: Vec<(PropertyKey, Property)>Properties in definition order, string and symbol keys interleaved.
kind: ObjectKindWhat kind of object this is.
extensible: boolWhether new properties may be added. Object.preventExtensions, seal and
freeze clear it, and nothing clears it back.
elements_writable: boolWhether array elements may be replaced.
Elements are not in the property table, so their attributes need somewhere to
live; Object.freeze clears this and Object.isFrozen reads it. A single
non-writable element is recorded in the property table instead, which is what
Object.defineProperty(a, "3", {configurable: false}) does.
home_object: Option<Gc<JsObject>>The object a method was defined on, which is what super resolves against.
Kept here rather than as a property because it is not observable: the spec calls
it [[HomeObject]] and no script can read it, so putting it in the property
table would leak it to Object.getOwnPropertyNames and JSON.stringify.
class_constructor: boolWhether this function is a class constructor, which may not be called without
new.