diff --git a/core/src/avm2/object/xml_object.rs b/core/src/avm2/object/xml_object.rs index a63186237570..0db11c0d5888 100644 --- a/core/src/avm2/object/xml_object.rs +++ b/core/src/avm2/object/xml_object.rs @@ -590,6 +590,41 @@ impl<'gc> TObject<'gc> for XmlObject<'gc> { Ok(()) } + fn get_next_enumerant( + self, + last_index: u32, + _activation: &mut Activation<'_, 'gc>, + ) -> Result, Error<'gc>> { + Ok(Some(if last_index == 0 { 1 } else { 0 })) + } + + fn get_enumerant_value( + self, + index: u32, + _activation: &mut Activation<'_, 'gc>, + ) -> Result, Error<'gc>> { + if index == 1 { + Ok(self.into()) + } else { + Ok(Value::Undefined) + } + } + + fn get_enumerant_name( + self, + index: u32, + _activation: &mut Activation<'_, 'gc>, + ) -> Result, Error<'gc>> { + if index == 1 { + Ok(index + .checked_sub(1) + .map(|index| index.into()) + .unwrap_or(Value::Undefined)) + } else { + Ok(Value::Undefined) + } + } + fn delete_property_local( self, activation: &mut Activation<'_, 'gc>, diff --git a/tests/tests/swfs/from_avmplus/e4x/Expressions/e11_2_2/test.toml b/tests/tests/swfs/from_avmplus/e4x/Expressions/e11_2_2/test.toml index e115772d5b3a..cf6123969a1d 100644 --- a/tests/tests/swfs/from_avmplus/e4x/Expressions/e11_2_2/test.toml +++ b/tests/tests/swfs/from_avmplus/e4x/Expressions/e11_2_2/test.toml @@ -1,2 +1 @@ num_ticks = 1 -known_failure = true # https://github.com/ruffle-rs/ruffle/issues/12351