document trying mechanism

This commit is contained in:
2026-05-03 22:05:54 +08:00
parent 7401f1ba5e
commit 88a205f419
8 changed files with 56 additions and 28 deletions
+6 -6
View File
@@ -75,7 +75,7 @@ impl<'gc> crate::Vm<'gc> {
let _span_id = reader.read_u32();
let key = reader.read_string_id();
let attrset = self.try_force::<Gc<AttrSet>>(reader, mc)?;
let attrset = self.force_and_retry::<Gc<AttrSet>>(reader, mc)?;
match attrset.lookup(key) {
Some(v) => {
@@ -95,7 +95,7 @@ impl<'gc> crate::Vm<'gc> {
) -> Step {
let _span_id = reader.read_u32();
let (attrset, key_val) = self.try_force::<(Gc<AttrSet>, StrictValue)>(reader, mc)?;
let (attrset, key_val) = self.force_and_retry::<(Gc<AttrSet>, StrictValue)>(reader, mc)?;
let key_sid = match ctx.get_string_id(key_val) {
Ok(id) => id,
@@ -191,7 +191,7 @@ impl<'gc> crate::Vm<'gc> {
let _span_id = reader.read_u32();
let key = reader.read_string_id();
let current = self.try_force::<StrictValue>(reader, mc)?;
let current = self.force_and_retry::<StrictValue>(reader, mc)?;
match current
.as_gc::<AttrSet>()
@@ -214,7 +214,7 @@ impl<'gc> crate::Vm<'gc> {
) -> Step {
let _span_id = reader.read_u32();
let (current, key_val) = self.try_force::<(StrictValue, StrictValue)>(reader, mc)?;
let (current, key_val) = self.force_and_retry::<(StrictValue, StrictValue)>(reader, mc)?;
let key_sid = match ctx.get_string_id(key_val) {
Ok(id) => id,
@@ -254,7 +254,7 @@ impl<'gc> crate::Vm<'gc> {
mc: &gc_arena::Mutation<'gc>,
) -> Step {
let key = reader.read_string_id();
let current = self.try_force::<StrictValue>(reader, mc)?;
let current = self.force_and_retry::<StrictValue>(reader, mc)?;
self.push(Value::new_inline(
current
@@ -275,7 +275,7 @@ impl<'gc> crate::Vm<'gc> {
reader: &mut BytecodeReader<'_>,
mc: &gc_arena::Mutation<'gc>,
) -> Step {
let (current, dyn_key) = self.try_force::<(StrictValue, StrictValue)>(reader, mc)?;
let (current, dyn_key) = self.force_and_retry::<(StrictValue, StrictValue)>(reader, mc)?;
let key_sid = match ctx.get_string_id(dyn_key) {
Ok(id) => id,