tests: Add test for with

This commit is contained in:
EmperorBale 2021-10-11 15:57:04 -07:00 committed by kmeisthax
parent 903246d5af
commit a9f5823074
5 changed files with 32 additions and 0 deletions

View File

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

View File

@ -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();
}

View File

@ -0,0 +1,4 @@
10
scope test
20
scope test

Binary file not shown.

Binary file not shown.