Fixed #1763 AS3 - initialization of activation object in some cases

This commit is contained in:
Jindra Petřík
2021-12-04 08:28:48 +01:00
parent 9e6548ceb0
commit 4197e4913b
11 changed files with 161 additions and 7 deletions

View File

@@ -29,5 +29,6 @@ program
#include "tests/TestSwitchGoto.script.asasm"
#include "tests/TestTryWhile.script.asasm"
#include "tests/TestPushWhile.script.asasm"
#include "tests/TestActivationProps.script.asasm"
; place to add next
end ; program

View File

@@ -0,0 +1,76 @@
class
refid "tests:TestActivationProps"
instance QName(PackageNamespace("tests"), "TestActivationProps")
extends QName(PackageNamespace(""), "Object")
flag SEALED
flag PROTECTEDNS
protectedns ProtectedNamespace("tests:TestActivationProps")
iinit
refid "tests:TestActivationProps/instance/init"
body
maxstack 1
localcount 1
initscopedepth 4
maxscopedepth 5
code
getlocal0
pushscope
getlocal0
constructsuper 0
returnvoid
end ; code
end ; body
end ; method
trait method QName(PackageNamespace(""), "run")
method
refid "tests:TestActivationProps/instance/run"
flag HAS_OPTIONAL
flag HAS_PARAM_NAMES
flag NEED_ACTIVATION
param QName(PackageNamespace(""),"int")
paramname "myvar"
returns QName(PackageNamespace(""), "void")
body
maxstack 2
localcount 4
initscopedepth 4
maxscopedepth 5
trait slot QName(PackageInternalNs("testing"),"myvar")
slotid 1
type QName(PackageNamespace(""),"int")
end ; trait
code
debug 1, "myvar", 0, 0
getlocal0
pushscope
newactivation
dup
setlocal 6
pushscope
findpropstrict QName(PackageInternalNs("testing"),"myvar")
getlocal1
setproperty QName(PackageInternalNs("testing"),"myvar")
returnvoid
end ; code
end ; body
end ; method
end ; trait
end ; instance
cinit
refid "tests:TestActivationProps/class/init"
body
maxstack 1
localcount 1
initscopedepth 3
maxscopedepth 4
code
getlocal0
pushscope
returnvoid
end ; code
end ; body
end ; method
end ; class

View File

@@ -0,0 +1,29 @@
script
sinit
refid "tests:TestActivationProps/init"
body
maxstack 2
localcount 1
initscopedepth 1
maxscopedepth 3
code
getlocal0
pushscope
findpropstrict Multiname("TestActivationProps", [PackageNamespace("tests")])
getlex QName(PackageNamespace(""), "Object")
pushscope
getlex Multiname("Object", [PrivateNamespace(null, "tests:TestActivationProps"), PackageNamespace(""), PackageNamespace("tests"), PackageInternalNs("tests"), Namespace("http://adobe.com/AS3/2006/builtin")])
newclass "tests:TestActivationProps"
popscope
initproperty QName(PackageNamespace("tests"), "TestActivationProps")
returnvoid
end ; code
end ; body
end ; method
trait class QName(PackageNamespace("tests"), "TestActivationProps")
#include "TestActivationProps.class.asasm"
end ; trait
end ; script