Fixed AS3 - direct editation - arguments object on method with activation

This commit is contained in:
Jindra Petřík
2021-12-04 14:49:38 +01:00
parent b0962137f9
commit c1dd430f43
7 changed files with 22 additions and 2 deletions

View File

@@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
- [#1762] AS3 - Auto adding returnvoid/return undefined
- [#1762] AS - switch detection (mostcommon pathpart)
- [#1763] AS3 - initialization of activation object in some cases
- AS3 - direct editation - arguments object on method with activation
## [15.0.0] - 2021-11-29
### Added

View File

@@ -1689,8 +1689,10 @@ public class AVM2SourceGenerator implements SourceGenerator {
NameAVM2Item n = (NameAVM2Item) an;
if (n.getVariableName().equals("arguments") & !n.isDefinition()) {
registerNames.add("arguments");
registerTypes.add(new TypeItem("Object"));
registerTypes.add(new TypeItem("Array"));
registerLines.add(0); //?
slotNames.add(n.getVariableName());
slotTypes.add(new TypeItem("Array"));
hasArguments = true;
break;
}

View File

@@ -16,7 +16,7 @@
</define>
<define append="true">
<name>CONFIG::timeStamp</name>
<value>'02.12.2021'</value>
<value>'04.12.2021'</value>
</define>
<define append="true">
<name>CONFIG::air</name>

View File

@@ -15,6 +15,7 @@ package
*/
public class Main extends Sprite
{
TestActivationArguments;
TestArguments;
TestCatchFinally;
TestChain2;

View File

@@ -0,0 +1,16 @@
package tests
{
public class TestActivationArguments
{
public function run():*
{
var func:Function = function(a:int, b:int):int {
return a + b;
}
if (arguments.length > 0){
trace(arguments[0]);
}
}
}
}