mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 19:21:11 +08:00
fix: DefineOwnProperty 臂写参数寄存器补顶帧守卫
This commit is contained in:
@@ -218,6 +218,9 @@ impl oxide_runtime_api::VmHost for Vm {
|
||||
fn arguments_mapping_alive(&self, state: &oxide_types::arguments_map::ArgumentsMapState) -> bool {
|
||||
self.arguments_mapping_alive(state)
|
||||
}
|
||||
fn is_top_frame(&self, frame_depth: u32) -> bool {
|
||||
self.is_top_frame(frame_depth)
|
||||
}
|
||||
fn ordinary_get(&mut self, obj: &JsObject, prop_name_si: u32, receiver: JsValue) -> Result<JsValue, String> {
|
||||
self.ordinary_get(obj, prop_name_si, receiver)
|
||||
}
|
||||
|
||||
@@ -20,6 +20,14 @@ impl Vm {
|
||||
self.frames.len() > depth && self.frames[depth].frame_id == state.frame_id
|
||||
}
|
||||
|
||||
/// 判定帧栈下标 `frame_depth` 处的帧是否为顶帧(当前帧)。
|
||||
///
|
||||
/// # 边界与前提
|
||||
/// - `frame_depth` 为创建帧在帧栈中的下标;帧弹出后下标越界返回 `false`。
|
||||
pub(crate) fn is_top_frame(&self, frame_depth: u32) -> bool {
|
||||
self.frames.len() == frame_depth as usize + 1
|
||||
}
|
||||
|
||||
/// 属性读入口:解析 `obj[prop_name_si]`,依次尝试数组 length 虚拟属性、
|
||||
/// 数组元素区、TypedArray 整数索引、命名属性槽,最后沿原型链查找。
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user