pub enum ExoticObject {
Show 19 variants
Ordinary,
Array {
elements: Vec<JsValue>,
},
Boolean(bool),
Number(f64),
StringObj(JsString),
Symbol(Box<JsSymbol>),
Function(JsFunction),
Map {
entries: IndexMap<JsMapKey, JsValue, BuildHasherDefault<FxHasher>>,
},
Set {
entries: IndexSet<JsMapKey, BuildHasherDefault<FxHasher>>,
},
Date {
timestamp: f64,
},
RegExp {
pattern: String,
flags: String,
compiled: Option<Rc<dyn CompiledRegex>>,
},
Generator(Rc<RefCell<GeneratorState>>),
BytecodeGenerator(Rc<RefCell<BytecodeGeneratorState>>),
Promise(Rc<RefCell<PromiseState>>),
Environment(EnvironmentData),
Enum(EnumData),
Proxy(ProxyData),
RawJSON(JsString),
PendingOrder {
id: u64,
},
}Expand description
Exotic object behavior
Variants§
Ordinary
Ordinary object
Array
Array exotic object - stores elements directly for O(1) indexed access
Boolean(bool)
Boolean wrapper object - stores primitive boolean value
Number(f64)
Number wrapper object - stores primitive number value
StringObj(JsString)
String wrapper object - stores primitive string value
Symbol(Box<JsSymbol>)
Symbol wrapper object - stores primitive symbol value
Function(JsFunction)
Function exotic object
Map
Map exotic object - stores key-value pairs preserving insertion order Uses IndexMap for O(1) lookup with SameValueZero key comparison
Set
Set exotic object - stores unique values preserving insertion order Uses IndexSet for O(1) lookup with SameValueZero comparison
Fields
entries: IndexSet<JsMapKey, BuildHasherDefault<FxHasher>>Date
Date exotic object - stores timestamp in milliseconds since Unix epoch
RegExp
RegExp exotic object - stores pattern, flags, and cached compiled regex
Fields
compiled: Option<Rc<dyn CompiledRegex>>Cached compiled regex. Lazily compiled on first use.
Generator(Rc<RefCell<GeneratorState>>)
Generator exotic object - stores generator state (AST-based)
BytecodeGenerator(Rc<RefCell<BytecodeGeneratorState>>)
Bytecode generator exotic object - stores bytecode generator state
Promise(Rc<RefCell<PromiseState>>)
Promise exotic object - stores promise state
Environment(EnvironmentData)
Environment exotic object - stores variable bindings
Enum(EnumData)
Enum exotic object - stores enum metadata
Proxy(ProxyData)
Proxy exotic object - wraps target with handler traps
RawJSON(JsString)
Raw JSON exotic object - stores a JSON string for literal insertion in JSON.stringify
PendingOrder
Pending order marker - triggers immediate VM suspension The id is the OrderId that will be used to match the response from host When detected, VM suspends and waits for host to provide a value via fulfill_orders()