diff --git a/core/tests/regression_tests.rs b/core/tests/regression_tests.rs index 3424b709e..cf5ceafb0 100644 --- a/core/tests/regression_tests.rs +++ b/core/tests/regression_tests.rs @@ -101,6 +101,7 @@ swf_tests! { (equals2_swf5, "avm1/equals2_swf5", 1), (equals2_swf6, "avm1/equals2_swf6", 1), (equals2_swf7, "avm1/equals2_swf7", 1), + (set_variable_scope, "avm1/set_variable_scope", 1), (slash_syntax, "avm1/slash_syntax", 2), (strictequals_swf6, "avm1/strictequals_swf6", 1), (global_is_bare, "avm1/global_is_bare", 1), diff --git a/core/tests/swfs/avm1/set_variable_scope/output.txt b/core/tests/swfs/avm1/set_variable_scope/output.txt new file mode 100644 index 000000000..10c237337 --- /dev/null +++ b/core/tests/swfs/avm1/set_variable_scope/output.txt @@ -0,0 +1,59 @@ +// foo: +undefined + +// _global.foo = 'global'; +// foo: +global + +// foo = 'root'; +// foo: +root +// _global.foo: +global + +// f() { +// foo = 'f'; +// bar = 'f bar'; +// foo: +f +// bar: +f bar +// } + +// foo: +f +// bar: +f bar + +// tellTarget(mc) { +// foo: +global +// foo = 'mc foo'; +// blah = 'mc blah'; +// } + +// foo: +f +// mc.foo: +mc foo +// blah: +undefined +// mc.blah: +mc blah + +// with(mc) { +// foo: +mc foo +// foo = 'mc foo2'; +// baz = 'mc baz'; +// } + +// foo: +f +// mc.foo: +mc foo2 +// baz: +mc baz +// mc.baz: +undefined + diff --git a/core/tests/swfs/avm1/set_variable_scope/test.fla b/core/tests/swfs/avm1/set_variable_scope/test.fla new file mode 100644 index 000000000..1fcf52368 Binary files /dev/null and b/core/tests/swfs/avm1/set_variable_scope/test.fla differ diff --git a/core/tests/swfs/avm1/set_variable_scope/test.swf b/core/tests/swfs/avm1/set_variable_scope/test.swf new file mode 100644 index 000000000..1257ff6ed Binary files /dev/null and b/core/tests/swfs/avm1/set_variable_scope/test.swf differ