Skip to main content

Obj

Struct Obj 

Source
pub struct Obj {
    pub props: PropMap<Value>,
    pub accessors: PropMap<Accessor>,
    pub attrs: PropMap<PropertyAttributes>,
    pub proto: Option<ObjRef>,
    pub kind: ObjKind,
    pub frozen: bool,
    pub sealed: bool,
    pub non_extensible: bool,
    pub null_proto: bool,
}
Expand description

ヒープオブジェクト本体。名前付きプロパティ + プロトタイプ + 種別。

Fields§

§props: PropMap<Value>§accessors: PropMap<Accessor>

Object.defineProperty で登録された getter/setter。

§attrs: PropMap<PropertyAttributes>§proto: Option<ObjRef>§kind: ObjKind§frozen: bool

Object.freeze() 済みか。真なら set_property/delete によるプロパティの 追加・変更・削除を無視する(非 strict モード相当の黙殺。Object.isFrozen() が読む)。

§sealed: bool

Object.seal() 済みか。真なら新規プロパティの追加・既存プロパティの削除を無視する (既存プロパティの値の変更は許可。frozen はこれも自動的に含意する)。

§non_extensible: bool

Object.preventExtensions() 済みか。真なら新規プロパティの追加のみを禁止する (削除・既存値の変更は許可。sealed/frozen はこれも自動的に含意する)。

§null_proto: bool

Object.create(null)/Object.groupBy()等、仕様上[[Prototype]]nullと明示されたオブジェクトか。proto: Noneだけでは「明示的に nullプロトタイプ」なのか「単に通常オブジェクトでprotoチェーンが 尽きた」なのかをget_propertyの共通メソッドフォールバック (interp/properties.rsobject_get呼び出し)が区別できず、 Object.create(null).hasOwnProperty等がフォールバック経由で 誤って動いてしまうバグがあった(2026-07-18 発見・実装)。

Implementations§

Source§

impl Obj

Source

pub fn plain() -> ObjRef

Source

pub fn array(items: Vec<Value>) -> ObjRef

Source

pub fn function(data: FunctionData) -> ObjRef

Source

pub fn native(name: &str, func: NativeFn) -> ObjRef

Source

pub fn host(tag: &str) -> ObjRef

Source

pub fn dom(node_idx: usize) -> ObjRef

Source

pub fn map_obj(entries: Vec<(Value, Value)>) -> ObjRef

Source

pub fn set_obj(items: Vec<Value>) -> ObjRef

Source

pub fn promise(state: Rc<RefCell<PromiseState>>) -> ObjRef

Source

pub fn resolver(state: Rc<RefCell<PromiseState>>, reject: bool) -> ObjRef

Source

pub fn generator(state: GenState) -> ObjRef

Source

pub fn regexp(data: RegExpData) -> ObjRef

Source

pub fn proxy(target: ObjRef, handler: ObjRef) -> ObjRef

Source

pub fn date_obj(epoch_ms: f64) -> ObjRef

Source

pub fn bound(target: Value, bound_this: Value, bound_args: Vec<Value>) -> ObjRef

Source

pub fn is_callable(&self) -> bool

Auto Trait Implementations§

§

impl !RefUnwindSafe for Obj

§

impl !Send for Obj

§

impl !Sync for Obj

§

impl !UnwindSafe for Obj

§

impl Freeze for Obj

§

impl Unpin for Obj

§

impl UnsafeUnpin for Obj

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.