diff --git a/core/src/avm2/amf.rs b/core/src/avm2/amf.rs index 0303d6abb82aa..393d582055842 100644 --- a/core/src/avm2/amf.rs +++ b/core/src/avm2/amf.rs @@ -202,11 +202,15 @@ pub fn recursive_serialize<'gc>( ) -> Result<(), Error<'gc>> { if let Some(static_properties) = static_properties { let vtable = obj.vtable(); + // TODO: respect versioning let mut props = vtable.public_properties(); // Flash appears to use vtable iteration order, but we sort ours // to make our test output consistent. props.sort_by_key(|(name, _)| name.to_utf8_lossy().to_string()); for (name, prop) in props { + if let Property::Method { .. } = prop { + continue; + } if let Property::Virtual { get, set } = prop { if !(get.is_some() && set.is_some()) { continue; diff --git a/tests/tests/swfs/avm2/bytearray_method_serialization/Test.as b/tests/tests/swfs/avm2/bytearray_method_serialization/Test.as new file mode 100644 index 0000000000000..6853e5d032f39 --- /dev/null +++ b/tests/tests/swfs/avm2/bytearray_method_serialization/Test.as @@ -0,0 +1,19 @@ +// compiled with mxmlc (and modified to SWF v9) + +import flash.utils.ByteArray; +import flash.geom.Point; + +var p = new Point(); +var b = new ByteArray(); +b.writeObject(p); +trace(b.length); + +package { + import flash.display.MovieClip; + + public class Test extends MovieClip { + public function Test() { + return; + } + } +} diff --git a/tests/tests/swfs/avm2/bytearray_method_serialization/output.txt b/tests/tests/swfs/avm2/bytearray_method_serialization/output.txt new file mode 100644 index 0000000000000..7273c0fa8c522 --- /dev/null +++ b/tests/tests/swfs/avm2/bytearray_method_serialization/output.txt @@ -0,0 +1 @@ +25 diff --git a/tests/tests/swfs/avm2/bytearray_method_serialization/test.swf b/tests/tests/swfs/avm2/bytearray_method_serialization/test.swf new file mode 100644 index 0000000000000..9e64a67f5d0ec Binary files /dev/null and b/tests/tests/swfs/avm2/bytearray_method_serialization/test.swf differ diff --git a/tests/tests/swfs/avm2/bytearray_method_serialization/test.toml b/tests/tests/swfs/avm2/bytearray_method_serialization/test.toml new file mode 100644 index 0000000000000..dbee897f5863d --- /dev/null +++ b/tests/tests/swfs/avm2/bytearray_method_serialization/test.toml @@ -0,0 +1 @@ +num_frames = 1