Fixed #1795 AS3 P-code - optional (default parameter values) saving

This commit is contained in:
Jindra Petřík
2022-11-05 10:56:23 +01:00
parent edf89a7635
commit 0d4945b8d6
3 changed files with 5 additions and 1 deletions

View File

@@ -1230,6 +1230,8 @@ public class ASM3Parser {
for (int i = 0; i < optional.size(); i++) {
info.optional[i] = optional.get(i);
}
} else {
info.optional = new ValueKind[0];
}
abc.refreshMultinameNamespaceSuffixes();
return code;

View File

@@ -342,7 +342,7 @@ public class MethodInfo {
} else {
writer.hilightSpecial(constants.getMultiname(param_types[i]).getName(constants, fullyQualifiedNames, false, true), HighlightSpecialType.PARAM, i);
}
if (optional != null) {
if (optional != null && flagHas_optional()) {
if (i >= param_types.length - optional.length) {
int optionalIndex = i - (param_types.length - optional.length);
writer.appendNoHilight(" = ");