tests: Add test for correct scope in SetVariable

This commit is contained in:
Mike Welsh 2020-01-06 19:08:30 -08:00
parent ab63f221ed
commit a60fadf0bb
4 changed files with 60 additions and 0 deletions

View File

@ -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),

View File

@ -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

Binary file not shown.

Binary file not shown.