Skip to main content

ArrOp

Enum ArrOp 

Source
pub(crate) enum ArrOp {
    Push(usize),
    Pop,
    Shift,
    Unshift(usize),
    Splice(usize, usize, usize),
    Fill(usize, usize),
    CopyWithin(usize, usize),
    Reverse,
    Sort,
}
Expand description

配列の「書き換えを拒む状態」の検査。【2026-11-19】 Array.prototype の書き込み系メソッド(push・pop・shift・unshift・splice・fill・copyWithin・reverse・sort)は、 仕様上 Set(O, P, V, true) / DeletePropertyOrThrow を使うので、Object.freeze 済み・length が 書き換え不可・拡張不可の配列では strict / sloppy を問わず TypeError になる (ECMA-262 §23.1.3.* の各アルゴリズム、§7.3.4 Set の Throw=true、§7.3.10 DeletePropertyOrThrow、 §10.1.9.2 OrdinarySetWithOwnDescriptor、§10.4.2.4 ArraySetLength)。 以前はフラグを見ずに中身を直接書き換えており、凍結した配列に push できていた。 実装は「先に全部検査してから書く」形(仕様は途中まで書いてから投げる。途中経過の差は 例外を捕まえた後の配列の中身にだけ出る)。何も掛かっていない配列は一度の借用で素通りする。

Variants§

§

Push(usize)

§

Pop

§

Shift

§

Unshift(usize)

§

Splice(usize, usize, usize)

先頭の位置・取り除く数・差し込む数

§

Fill(usize, usize)

§

CopyWithin(usize, usize)

書き込み先の先頭・個数

§

Reverse

§

Sort

Auto Trait Implementations§

§

impl Freeze for ArrOp

§

impl RefUnwindSafe for ArrOp

§

impl Send for ArrOp

§

impl Sync for ArrOp

§

impl Unpin for ArrOp

§

impl UnsafeUnpin for ArrOp

§

impl UnwindSafe for ArrOp

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.