- AS3 - "native" modifier only for methods with EXPLICIT flag
- AS3 - AS3 builtin namespace visibility

Changed
- AS3 - order of modifiers: final, override, access, static, native
This commit is contained in:
Jindra Petřík
2022-12-18 23:06:39 +01:00
parent a713099ba4
commit 4dbb74cc45
5 changed files with 17 additions and 13 deletions

View File

@@ -2132,8 +2132,8 @@ public class ABC implements Openable {
return null;
}
String name = constants.getString(ns.name_index);
if (name.equals("http://adobe.com/AS3/2006/builtin")) {
return null;
if (name.equals("http://adobe.com/AS3/2006/builtin")) { //TODO: This should really be resolved using ABC indexing, not hardcoded constant
return DottedChain.parseNoSuffix("AS3");
}
for (ABCContainerTag abcTag : getAbcTags()) {
DottedChain dc = abcTag.getABC().nsValueToName(name);

View File

@@ -367,8 +367,8 @@ public class Multiname {
if (nskind == Namespace.KIND_NAMESPACE || nskind == Namespace.KIND_PACKAGE_INTERNAL) {
DottedChain dc = abc.findCustomNs(namespace_index);
String nsname = dc != null ? dc.getLast() : null;
if (nsname != null) {
if (nsname != null && !"AS3".equals(nsname)) {
String identifier = dontDeobfuscate ? nsname : IdentifiersDeobfuscation.printIdentifier(true, nsname);
if (identifier != null && !identifier.isEmpty()) {
return nsname + "::" + name;

View File

@@ -331,6 +331,11 @@ public abstract class Trait implements Cloneable, Serializable {
}
public final GraphTextWriter getModifiers(ABC abc, boolean isStatic, GraphTextWriter writer) {
if ((kindFlags & ATTR_Final) > 0) {
if (!isStatic) {
writer.appendNoHilight("final ");
}
}
if ((kindFlags & ATTR_Override) > 0) {
writer.appendNoHilight("override ");
}
@@ -360,12 +365,7 @@ public abstract class Trait implements Cloneable, Serializable {
} else {
writer.appendNoHilight("static ");
}
}
if ((kindFlags & ATTR_Final) > 0) {
if (!isStatic) {
writer.appendNoHilight("final ");
}
}
}
return writer;
}

View File

@@ -91,12 +91,13 @@ public class TraitMethodGetterSetter extends Trait {
addKind = "set ";
}
MethodBody body = abc.findBody(method_info);
if (((classIndex == -1) || (!abc.instance_info.get(classIndex).isInterface())) && (body == null)) {
getModifiers(abc, isStatic, writer);
if (abc.method_info.get(method_info).flagExplicit()) {
writer.appendNoHilight("native ");
}
getModifiers(abc, isStatic, writer);
writer.hilightSpecial("function " + addKind, HighlightSpecialType.TRAIT_TYPE);
writer.hilightSpecial(getName(abc).getName(abc.constants, fullyQualifiedNames, false, true), HighlightSpecialType.TRAIT_NAME);
writer.appendNoHilight("(");