diff --git a/tests/tests/regression_tests.rs b/tests/tests/regression_tests.rs index 2a563b978..f8dec28f6 100644 --- a/tests/tests/regression_tests.rs +++ b/tests/tests/regression_tests.rs @@ -668,6 +668,7 @@ swf_tests! { (as3_vector_legacy, "avm2/vector_legacy", 1), (as3_vector_enumeration, "avm2/vector_enumeration", 1), (as3_sound_valueof, "avm2/sound_valueof", 1), + (as3_with, "avm2/with", 1), (as3_sound_embeddedprops, "avm2/sound_embeddedprops", 1), (as3_soundtransform, "avm2/soundtransform", 1), (as3_movieclip_soundtransform, "avm2/movieclip_soundtransform", 49), diff --git a/tests/tests/swfs/avm2/with/Test.as b/tests/tests/swfs/avm2/with/Test.as new file mode 100644 index 000000000..7798f5a82 --- /dev/null +++ b/tests/tests/swfs/avm2/with/Test.as @@ -0,0 +1,27 @@ +package { + public class Test {} +} + +with (Math) { + trace(abs(-10)); +} + +var test = {"example": "scope test"} + +with (test) { + trace(example); +} + +with (Math) { + var f = function () { + trace(floor(20.3)) + } + f(); +} + +with (test) { + var f = function () { + trace(example) + } + f(); +} \ No newline at end of file diff --git a/tests/tests/swfs/avm2/with/output.txt b/tests/tests/swfs/avm2/with/output.txt new file mode 100644 index 000000000..3cc1da6d2 --- /dev/null +++ b/tests/tests/swfs/avm2/with/output.txt @@ -0,0 +1,4 @@ +10 +scope test +20 +scope test \ No newline at end of file diff --git a/tests/tests/swfs/avm2/with/test.fla b/tests/tests/swfs/avm2/with/test.fla new file mode 100644 index 000000000..9a07c5531 Binary files /dev/null and b/tests/tests/swfs/avm2/with/test.fla differ diff --git a/tests/tests/swfs/avm2/with/test.swf b/tests/tests/swfs/avm2/with/test.swf new file mode 100644 index 000000000..6edc77b8b Binary files /dev/null and b/tests/tests/swfs/avm2/with/test.swf differ