#[non_exhaustive]pub struct HostObject {
pub class_name: &'static str,
pub marker: &'static str,
pub is_boxed_primitive: bool,
}Expand description
A single host-object identity: the JavaScript constructor name, the dedicated identity marker key stamped onto the constructed record, and whether the identity denotes a boxed primitive wrapper.
The marker is the __smelt_<name> key that gives the constructed record its
distinct identity. instanceof resolves through this key, and the runtime
for-in / Object.keys filters hide records carrying it so a host object never
leaks its internal marker keys as enumerable properties.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.class_name: &'static strThe JavaScript constructor / class name ("WeakMap", "ArrayBuffer").
marker: &'static strThe dedicated identity marker key ("__smelt_weakmap").
is_boxed_primitive: boolWhether this identity is a boxed primitive wrapper (new Number(1)).
Boxed wrappers are distinct from the same-named coercion calls
(Number(x)), which lower to primitive values. The wrapper object has
typeof === "object", so the runtime typeof narrowing must miss it while
instanceof still resolves through the marker.