diff --git a/core/src/avm1/globals/array.rs b/core/src/avm1/globals/array.rs index 23f0bc43d..2c24e4e5b 100644 --- a/core/src/avm1/globals/array.rs +++ b/core/src/avm1/globals/array.rs @@ -256,7 +256,8 @@ pub fn reverse<'gc>( this.set_array_element(i, values.pop().unwrap(), activation.context.gc_context); } - Ok(Value::Undefined) + // Some docs incorrectly say reverse returns Void. + Ok(this.into()) } pub fn join<'gc>( diff --git a/core/tests/swfs/avm1/array_trivial/output.txt b/core/tests/swfs/avm1/array_trivial/output.txt index 035733f31..24cd22755 100644 --- a/core/tests/swfs/avm1/array_trivial/output.txt +++ b/core/tests/swfs/avm1/array_trivial/output.txt @@ -86,6 +86,11 @@ b // array b,a,c +// array = array.reverse(); array = array.reverse(); + +// array +b,a,c + // array.join(" / ") b / a / c diff --git a/core/tests/swfs/avm1/array_trivial/test.fla b/core/tests/swfs/avm1/array_trivial/test.fla index 690c7f699..d8841c6aa 100644 Binary files a/core/tests/swfs/avm1/array_trivial/test.fla and b/core/tests/swfs/avm1/array_trivial/test.fla differ diff --git a/core/tests/swfs/avm1/array_trivial/test.swf b/core/tests/swfs/avm1/array_trivial/test.swf index 15e495182..fea6c36ff 100644 Binary files a/core/tests/swfs/avm1/array_trivial/test.swf and b/core/tests/swfs/avm1/array_trivial/test.swf differ