diff --git a/tests/tests/swfs/avm2/shared_object/Test.as b/tests/tests/swfs/avm2/shared_object/Test.as index c11570ac8f1c..f5d74c4a732b 100644 --- a/tests/tests/swfs/avm2/shared_object/Test.as +++ b/tests/tests/swfs/avm2/shared_object/Test.as @@ -82,6 +82,22 @@ trace() trace("otherObj dump:") dump(otherObj.data.props) + + // Test SharedObject.clear() + trace(); + var previousData = obj.data; + trace("obj.clear()"); + obj.clear(); + trace("obj == previousData: " + (obj.data == previousData)); + + trace(); + trace("obj dump:"); + dump(obj.data); + + trace(); + trace("obj dump again:"); + obj = SharedObject.getLocal("RuffleTest", "/"); + dump(obj.data); } } } diff --git a/tests/tests/swfs/avm2/shared_object/output2.txt b/tests/tests/swfs/avm2/shared_object/output2.txt index a52d3653bd2b..b6a34b6604ab 100644 --- a/tests/tests/swfs/avm2/shared_object/output2.txt +++ b/tests/tests/swfs/avm2/shared_object/output2.txt @@ -24,3 +24,10 @@ otherObj dump: 6 = elem0,,,,elem4 type object 7 = 1,2,3 type object 8 = (UTC) Sun Jan 25 20:31:23 1970 UTC + +obj.clear() +obj == previousData: false + +obj dump: + +obj dump again: diff --git a/tests/tests/swfs/avm2/shared_object/test.swf b/tests/tests/swfs/avm2/shared_object/test.swf index ab5e5c7dba81..f7c6e7c646c9 100644 Binary files a/tests/tests/swfs/avm2/shared_object/test.swf and b/tests/tests/swfs/avm2/shared_object/test.swf differ