mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-17 15:48:08 +00:00
Added AS3 Display missing namespaces along traits as §§namespace("url")
Added #1892 AS3 option to select SWF dependencies to properly resolve namespaces, types, etc. (currently in GUI only) Fixed AS3 P-code ValueKind namespaces handling Fixed AS3 direct editation - namespace definition without explicit value
This commit is contained in:
@@ -2222,7 +2222,10 @@ public class ABC implements Openable {
|
||||
String name = constants.getString(ns.name_index);
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
return getSwf().getAbcIndex().nsValueToName(name);
|
||||
/*
|
||||
for (ABCContainerTag abcTag : getAbcTags()) {
|
||||
DottedChain dc = abcTag.getABC().nsValueToName(name);
|
||||
nsname = dc.getLast();
|
||||
@@ -2233,8 +2236,8 @@ public class ABC implements Openable {
|
||||
if (!nsname.isEmpty()) {
|
||||
return dc;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}*/
|
||||
//return null;
|
||||
}
|
||||
|
||||
public void clearPacksCache() {
|
||||
|
||||
@@ -633,8 +633,9 @@ public class ASM3Parser {
|
||||
value_kind = ValueKind.CONSTANT_PackageNamespace;
|
||||
break;
|
||||
}
|
||||
lexer.pushback(type);
|
||||
expected(ParsedSymbol.TYPE_PARENT_OPEN, "(", lexer);
|
||||
value_index = parseNamespace(constants, lexer);
|
||||
expected(ParsedSymbol.TYPE_PARENT_CLOSE, ")", lexer);
|
||||
break;
|
||||
default:
|
||||
if (Configuration._debugMode.get()) {
|
||||
|
||||
@@ -1875,7 +1875,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
}
|
||||
|
||||
for (int i = 0; i < paramValues.size(); i++) {
|
||||
optional[i] = getValueKind(Namespace.KIND_NAMESPACE/*FIXME*/, paramTypes.get(paramTypes.size() - paramValues.size() + i), paramValues.get(i));
|
||||
optional[i] = getValueKind(Namespace.KIND_NAMESPACE/*FIXME*/, paramTypes.get(paramTypes.size() - paramValues.size() + i), paramValues.get(i), false);
|
||||
if (optional[i] == null) {
|
||||
throw new CompilationException("Default value must be compiletime constant", line);
|
||||
}
|
||||
@@ -2059,7 +2059,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
return mindex;
|
||||
}
|
||||
|
||||
public ValueKind getValueKind(int ns, GraphTargetItem type, GraphTargetItem val) {
|
||||
public ValueKind getValueKind(int ns, GraphTargetItem type, GraphTargetItem val, boolean generatedNs) {
|
||||
|
||||
if (val instanceof BooleanAVM2Item) {
|
||||
BooleanAVM2Item bi = (BooleanAVM2Item) val;
|
||||
@@ -2084,7 +2084,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
if (val instanceof StringAVM2Item) {
|
||||
StringAVM2Item sval = (StringAVM2Item) val;
|
||||
if (isNs) {
|
||||
return new ValueKind(namespace(Namespace.KIND_NAMESPACE, sval.getValue()), ValueKind.CONSTANT_Namespace);
|
||||
return new ValueKind(namespace(generatedNs ? Namespace.KIND_PACKAGE_INTERNAL : Namespace.KIND_NAMESPACE, sval.getValue()), ValueKind.CONSTANT_Namespace);
|
||||
} else {
|
||||
return new ValueKind(str(sval.getValue()), ValueKind.CONSTANT_Utf8);
|
||||
}
|
||||
@@ -2394,8 +2394,10 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
namespace = sai.pkg == null ? 0 : sai.pkg.getCpoolIndex(abcIndex);
|
||||
metadata = generateMetadata(((SlotAVM2Item) item).metadata);
|
||||
}
|
||||
boolean generatedNs = false;
|
||||
if (item instanceof ConstAVM2Item) {
|
||||
ConstAVM2Item cai = (ConstAVM2Item) item;
|
||||
generatedNs = cai.generatedNs;
|
||||
if (cai.isStatic() != generateStatic) {
|
||||
continue;
|
||||
}
|
||||
@@ -2415,7 +2417,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
}
|
||||
tsc.type_index = isNamespace ? 0 : (type == null ? 0 : typeName(localData, type));
|
||||
|
||||
ValueKind vk = getValueKind(namespace, type, val);
|
||||
ValueKind vk = getValueKind(namespace, type, val, generatedNs);
|
||||
if (vk == null) {
|
||||
tsc.value_index = ValueKind.CONSTANT_Undefined;
|
||||
tsc.value_kind = ValueKind.CONSTANT_Undefined;
|
||||
|
||||
@@ -83,6 +83,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.operations.SubtractAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.operations.TypeOfAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.operations.URShiftAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.parser.AVM2ParseException;
|
||||
import static com.jpexs.decompiler.flash.abc.avm2.parser.script.SymbolType.PREPROCESSOR;
|
||||
import com.jpexs.decompiler.flash.abc.types.Namespace;
|
||||
import com.jpexs.decompiler.flash.abc.types.ScriptInfo;
|
||||
import com.jpexs.decompiler.flash.action.swf4.ActionIf;
|
||||
@@ -648,6 +649,7 @@ public class ActionScript3Parser {
|
||||
boolean isPrivate = false;
|
||||
|
||||
String customNs = null;
|
||||
String rawCustomNs = null;
|
||||
NamespaceItem namespace = null;
|
||||
ParsedSymbol s = lex();
|
||||
//static class initializer
|
||||
@@ -660,7 +662,7 @@ public class ActionScript3Parser {
|
||||
List<Map.Entry<String, Map<String, String>>> metadata = parseMetadata();
|
||||
s = lex();
|
||||
|
||||
while (s.isType(SymbolType.STATIC, SymbolType.PUBLIC, SymbolType.PRIVATE, SymbolType.PROTECTED, SymbolType.OVERRIDE, SymbolType.FINAL, SymbolType.DYNAMIC, SymbolGroup.IDENTIFIER, SymbolType.INTERNAL)) {
|
||||
while (s.isType(SymbolType.STATIC, SymbolType.PUBLIC, SymbolType.PRIVATE, SymbolType.PROTECTED, SymbolType.OVERRIDE, SymbolType.FINAL, SymbolType.DYNAMIC, SymbolGroup.IDENTIFIER, SymbolType.INTERNAL, SymbolType.PREPROCESSOR)) {
|
||||
if (s.type == SymbolType.FINAL) {
|
||||
if (isFinal) {
|
||||
throw new AVM2ParseException("Only one final keyword allowed", lexer.yyline());
|
||||
@@ -714,6 +716,19 @@ public class ActionScript3Parser {
|
||||
case INTERNAL:
|
||||
namespace = packageInternalNs;
|
||||
break;
|
||||
|
||||
|
||||
case PREPROCESSOR:
|
||||
if (((String)s.value).toLowerCase().equals("namespace")) {
|
||||
expectedType(SymbolType.PARENT_OPEN);
|
||||
s = lex();
|
||||
expected(s, lexer.yyline(), SymbolType.STRING);
|
||||
namespace = new NamespaceItem((String)s.value, Namespace.KIND_NAMESPACE);
|
||||
expectedType(SymbolType.PARENT_CLOSE);
|
||||
} else {
|
||||
lexer.pushback(s);
|
||||
}
|
||||
break;
|
||||
}
|
||||
s = lex();
|
||||
}
|
||||
@@ -725,7 +740,7 @@ public class ActionScript3Parser {
|
||||
}
|
||||
if (namespace == null && customNs != null) {
|
||||
//Special: it will be resolved later:
|
||||
namespace = new NamespaceItem(customNs, Namespace.KIND_NAMESPACE);
|
||||
namespace = new NamespaceItem(customNs, NamespaceItem.KIND_NAMESPACE_CUSTOM);
|
||||
}
|
||||
|
||||
switch (s.type) {
|
||||
@@ -833,6 +848,7 @@ public class ActionScript3Parser {
|
||||
String nval;
|
||||
s = lex();
|
||||
|
||||
boolean generatedNs = false;
|
||||
if (s.type == SymbolType.ASSIGN) {
|
||||
s = lex();
|
||||
expected(s, lexer.yyline(), SymbolType.STRING);
|
||||
@@ -840,12 +856,13 @@ public class ActionScript3Parser {
|
||||
s = lex();
|
||||
} else {
|
||||
nval = (pkg.name.toRawString() + ":" + classNameStr) + "/" + nname;
|
||||
generatedNs = true;
|
||||
}
|
||||
if (s.type != SymbolType.SEMICOLON) {
|
||||
lexer.pushback(s);
|
||||
}
|
||||
|
||||
ConstAVM2Item ns = new ConstAVM2Item(metadata, namespace, customNs, true, nname, new TypeItem(DottedChain.NAMESPACE), new StringAVM2Item(null, null, nval), lexer.yyline());
|
||||
ConstAVM2Item ns = new ConstAVM2Item(metadata, namespace, customNs, true, nname, new TypeItem(DottedChain.NAMESPACE), new StringAVM2Item(null, null, nval), lexer.yyline(), generatedNs);
|
||||
traits.add(ns);
|
||||
break;
|
||||
case CONST:
|
||||
@@ -887,7 +904,7 @@ public class ActionScript3Parser {
|
||||
}
|
||||
GraphTargetItem tar;
|
||||
if (isConst) {
|
||||
tar = new ConstAVM2Item(metadata, namespace, customNs, isStatic, vcname, type, value, lexer.yyline());
|
||||
tar = new ConstAVM2Item(metadata, namespace, customNs, isStatic, vcname, type, value, lexer.yyline(), false);
|
||||
} else {
|
||||
tar = new SlotAVM2Item(metadata, namespace, customNs, isStatic, vcname, type, value, lexer.yyline());
|
||||
}
|
||||
@@ -1111,7 +1128,7 @@ public class ActionScript3Parser {
|
||||
}
|
||||
GraphTargetItem tar;
|
||||
if (isConst) {
|
||||
tar = new ConstAVM2Item(metadata, ns, null, false, vcname, type, value, lexer.yyline());
|
||||
tar = new ConstAVM2Item(metadata, ns, null, false, vcname, type, value, lexer.yyline(), false);
|
||||
} else {
|
||||
tar = new SlotAVM2Item(metadata, ns, null, false, vcname, type, value, lexer.yyline());
|
||||
}
|
||||
@@ -1131,19 +1148,21 @@ public class ActionScript3Parser {
|
||||
String nval;
|
||||
s = lex();
|
||||
|
||||
boolean generatedNs = false;
|
||||
if (s.type == SymbolType.ASSIGN) {
|
||||
s = lex();
|
||||
expected(s, lexer.yyline(), SymbolType.STRING);
|
||||
nval = s.value.toString();
|
||||
s = lex();
|
||||
} else {
|
||||
nval = ns + "/" + nname;
|
||||
generatedNs = true;
|
||||
nval = ns.name.toRawString() + ":" + nname;
|
||||
}
|
||||
if (s.type != SymbolType.SEMICOLON) {
|
||||
lexer.pushback(s);
|
||||
}
|
||||
|
||||
traits.add(new ConstAVM2Item(metadata, ns, null, true, nname, new TypeItem(DottedChain.NAMESPACE), new StringAVM2Item(null, null, nval), lexer.yyline()));
|
||||
traits.add(new ConstAVM2Item(metadata, ns, null, true, nname, new TypeItem(DottedChain.NAMESPACE), new StringAVM2Item(null, null, nval), lexer.yyline(), generatedNs));
|
||||
break;
|
||||
default:
|
||||
lexer.pushback(s);
|
||||
|
||||
@@ -42,12 +42,14 @@ public class ConstAVM2Item extends AVM2Item {
|
||||
public int line;
|
||||
|
||||
public NamespaceItem pkg;
|
||||
|
||||
public boolean generatedNs;
|
||||
|
||||
public boolean isStatic() {
|
||||
return isStatic;
|
||||
}
|
||||
|
||||
public ConstAVM2Item(List<Map.Entry<String, Map<String, String>>> metadata, NamespaceItem pkg, String customNamespace, boolean isStatic, String var, GraphTargetItem type, GraphTargetItem value, int line) {
|
||||
public ConstAVM2Item(List<Map.Entry<String, Map<String, String>>> metadata, NamespaceItem pkg, String customNamespace, boolean isStatic, String var, GraphTargetItem type, GraphTargetItem value, int line, boolean generatedNs) {
|
||||
|
||||
super(null, null, NOPRECEDENCE, value);
|
||||
this.metadata = metadata;
|
||||
@@ -57,6 +59,7 @@ public class ConstAVM2Item extends AVM2Item {
|
||||
this.var = var;
|
||||
this.type = type;
|
||||
this.customNamespace = customNamespace;
|
||||
this.generatedNs = generatedNs;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,6 +34,8 @@ import java.util.Objects;
|
||||
*/
|
||||
public class NamespaceItem {
|
||||
|
||||
public static final int KIND_NAMESPACE_CUSTOM = -2;
|
||||
|
||||
public DottedChain name;
|
||||
|
||||
public int kind;
|
||||
@@ -89,6 +91,9 @@ public class NamespaceItem {
|
||||
return;
|
||||
}
|
||||
if (kind == Namespace.KIND_NAMESPACE) {
|
||||
nsIndex = abcIndex.getSelectedAbc().constants.getNamespaceId(Namespace.KIND_NAMESPACE, name, 0, true);
|
||||
}
|
||||
if (kind == KIND_NAMESPACE_CUSTOM) {
|
||||
String custom = name.toRawString();
|
||||
PropertyAVM2Item prop = new PropertyAVM2Item(null, false, custom, "", abcIndex, openedNamespaces, new ArrayList<>());
|
||||
Reference<ValueKind> value = new Reference<>(null);
|
||||
@@ -125,7 +130,7 @@ public class NamespaceItem {
|
||||
}
|
||||
}
|
||||
|
||||
throw new CompilationException("Namespace \"" + name + "\"+not defined", -1);
|
||||
throw new CompilationException("Namespace \"" + name + "\" not defined", -1);
|
||||
}
|
||||
nsIndex = abcIndex.getSelectedAbc().constants.getNamespaceId(Namespace.KIND_NAMESPACE,
|
||||
outAbc.getVal().constants.getNamespace(value.getVal().value_index).getName(outAbc.getVal().constants), 0, true);
|
||||
|
||||
@@ -158,7 +158,7 @@ public class ValueKind {
|
||||
case CONSTANT_Undefined:
|
||||
ret = "undefined";
|
||||
break;
|
||||
case CONSTANT_Namespace:
|
||||
case CONSTANT_Namespace:
|
||||
case CONSTANT_PackageInternalNs:
|
||||
case CONSTANT_ProtectedNamespace:
|
||||
case CONSTANT_ExplicitNamespace:
|
||||
@@ -200,13 +200,34 @@ public class ValueKind {
|
||||
case CONSTANT_Undefined:
|
||||
ret = "Undefined()"; //"Void()" is also synonym
|
||||
break;
|
||||
case CONSTANT_Namespace:
|
||||
case CONSTANT_Namespace:
|
||||
case CONSTANT_PackageInternalNs:
|
||||
case CONSTANT_ProtectedNamespace:
|
||||
case CONSTANT_ExplicitNamespace:
|
||||
case CONSTANT_StaticProtectedNs:
|
||||
case CONSTANT_PrivateNs:
|
||||
ret = constants.getNamespace(value_index).getKindStr() + "(\"" + constants.getNamespace(value_index).getName(constants).toRawString() + "\")"; //assume not null name
|
||||
case CONSTANT_PrivateNs:
|
||||
String nsVal = constants.getNamespace(value_index).getKindStr() + "(\"" + constants.getNamespace(value_index).getName(constants).toRawString() + "\")"; //assume not null name
|
||||
|
||||
switch (value_kind) {
|
||||
case CONSTANT_Namespace:
|
||||
ret = "Namespace(" + nsVal + ")";
|
||||
break;
|
||||
case CONSTANT_PackageInternalNs:
|
||||
ret = "PackageInternalNs(" + nsVal + ")";
|
||||
break;
|
||||
case CONSTANT_ProtectedNamespace:
|
||||
ret = "ProtectedNamespace(" + nsVal + ")";
|
||||
break;
|
||||
case CONSTANT_ExplicitNamespace:
|
||||
ret = "ExplicitNamespace(" + nsVal + ")";
|
||||
break;
|
||||
case CONSTANT_StaticProtectedNs:
|
||||
ret = "StaticProtectedNs(" + nsVal + ")";
|
||||
break;
|
||||
case CONSTANT_PrivateNs:
|
||||
ret = "PrivateNamespace(" + nsVal + ")";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -171,14 +171,14 @@ public abstract class Trait implements Cloneable, Serializable {
|
||||
return getName(abc).getNamespace(abc.constants).getName(abc.constants);
|
||||
}
|
||||
|
||||
public void getDependencies(int scriptIndex, int classIndex, boolean isStatic, String ignoredCustom, ABC abc, List<Dependency> dependencies, DottedChain ignorePackage, List<DottedChain> fullyQualifiedNames) throws InterruptedException {
|
||||
public void getDependencies(AbcIndexing abcIndex, int scriptIndex, int classIndex, boolean isStatic, String ignoredCustom, ABC abc, List<Dependency> dependencies, DottedChain ignorePackage, List<DottedChain> fullyQualifiedNames) throws InterruptedException {
|
||||
if (ignoredCustom == null) {
|
||||
Namespace n = getName(abc).getNamespace(abc.constants);
|
||||
if (n.kind == Namespace.KIND_NAMESPACE) {
|
||||
ignoredCustom = n.getName(abc.constants).toRawString();
|
||||
}
|
||||
}
|
||||
DependencyParser.parseDependenciesFromMultiname(ignoredCustom, abc, dependencies, getName(abc), ignorePackage, fullyQualifiedNames, DependencyType.NAMESPACE);
|
||||
DependencyParser.parseDependenciesFromMultiname(abcIndex, ignoredCustom, abc, dependencies, getName(abc), ignorePackage, fullyQualifiedNames, DependencyType.NAMESPACE);
|
||||
//DependencyParser.parseUsagesFromMultiname(ignoredCustom, abc, dependencies, getName(abc), ignorePackage, fullyQualifiedNames, DependencyType.NAMESPACE);
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ public abstract class Trait implements Cloneable, Serializable {
|
||||
if (ns.kind == Namespace.KIND_NAMESPACE) {
|
||||
customNs = ns.getName(abc.constants).toRawString();
|
||||
}
|
||||
getDependencies(scriptIndex, classIndex, isStatic, customNs, abc, dependencies, ignorePackage, new ArrayList<>());
|
||||
getDependencies(abcIndex, scriptIndex, classIndex, isStatic, customNs, abc, dependencies, ignorePackage, new ArrayList<>());
|
||||
|
||||
List<DottedChain> imports = new ArrayList<>();
|
||||
for (Dependency d : dependencies) {
|
||||
@@ -349,7 +349,11 @@ public abstract class Trait implements Cloneable, Serializable {
|
||||
|
||||
Namespace ns = m.getNamespace(abc.constants);
|
||||
|
||||
if (nsname != null) {
|
||||
if (ns.kind == Namespace.KIND_NAMESPACE && nsname == null) {
|
||||
writer.append("§§namespace(\"");
|
||||
writer.append(Helper.escapeActionScriptString(ns.getRawName(abc.constants)));
|
||||
writer.append("\") ");
|
||||
} else if (nsname != null) {
|
||||
String identifier = IdentifiersDeobfuscation.printIdentifier(true, nsname);
|
||||
if (identifier != null && !identifier.isEmpty()) {
|
||||
writer.appendNoHilight(identifier).appendNoHilight(" ");
|
||||
|
||||
@@ -78,31 +78,31 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDependencies(int scriptIndex, int classIndex, boolean isStatic, String customNs, ABC abc, List<Dependency> dependencies, DottedChain ignorePackage, List<DottedChain> fullyQualifiedNames) throws InterruptedException {
|
||||
super.getDependencies(scriptIndex, -1, false, customNs, abc, dependencies, ignorePackage == null ? getPackage(abc) : ignorePackage, fullyQualifiedNames);
|
||||
public void getDependencies(AbcIndexing abcIndex, int scriptIndex, int classIndex, boolean isStatic, String customNs, ABC abc, List<Dependency> dependencies, DottedChain ignorePackage, List<DottedChain> fullyQualifiedNames) throws InterruptedException {
|
||||
super.getDependencies(abcIndex, scriptIndex, -1, false, customNs, abc, dependencies, ignorePackage == null ? getPackage(abc) : ignorePackage, fullyQualifiedNames);
|
||||
ClassInfo classInfo = abc.class_info.get(class_info);
|
||||
InstanceInfo instanceInfo = abc.instance_info.get(class_info);
|
||||
DottedChain packageName = instanceInfo.getName(abc.constants).getNamespace(abc.constants).getName(abc.constants); //assume not null name
|
||||
|
||||
//DependencyParser.parseDependenciesFromMultiname(customNs, abc, dependencies, uses, abc.constants.getMultiname(instanceInfo.name_index), packageName, fullyQualifiedNames);
|
||||
if (instanceInfo.super_index > 0) {
|
||||
DependencyParser.parseDependenciesFromMultiname(customNs, abc, dependencies, abc.constants.getMultiname(instanceInfo.super_index), packageName, fullyQualifiedNames, DependencyType.INHERITANCE);
|
||||
DependencyParser.parseDependenciesFromMultiname(abcIndex, customNs, abc, dependencies, abc.constants.getMultiname(instanceInfo.super_index), packageName, fullyQualifiedNames, DependencyType.INHERITANCE);
|
||||
}
|
||||
for (int i : instanceInfo.interfaces) {
|
||||
DependencyParser.parseDependenciesFromMultiname(customNs, abc, dependencies, abc.constants.getMultiname(i), packageName, fullyQualifiedNames, DependencyType.INHERITANCE);
|
||||
DependencyParser.parseDependenciesFromMultiname(abcIndex, customNs, abc, dependencies, abc.constants.getMultiname(i), packageName, fullyQualifiedNames, DependencyType.INHERITANCE);
|
||||
}
|
||||
|
||||
//static
|
||||
classInfo.static_traits.getDependencies(scriptIndex, class_info, true, customNs, abc, dependencies, packageName, fullyQualifiedNames);
|
||||
classInfo.static_traits.getDependencies(abcIndex, scriptIndex, class_info, true, customNs, abc, dependencies, packageName, fullyQualifiedNames);
|
||||
|
||||
//static initializer
|
||||
DependencyParser.parseDependenciesFromMethodInfo(null, scriptIndex, class_info, true, customNs, abc, classInfo.cinit_index, dependencies, packageName, fullyQualifiedNames, new ArrayList<>());
|
||||
DependencyParser.parseDependenciesFromMethodInfo(abcIndex, null, scriptIndex, class_info, true, customNs, abc, classInfo.cinit_index, dependencies, packageName, fullyQualifiedNames, new ArrayList<>());
|
||||
|
||||
//instance
|
||||
instanceInfo.instance_traits.getDependencies(scriptIndex, class_info, false, customNs, abc, dependencies, packageName, fullyQualifiedNames);
|
||||
instanceInfo.instance_traits.getDependencies(abcIndex, scriptIndex, class_info, false, customNs, abc, dependencies, packageName, fullyQualifiedNames);
|
||||
|
||||
//instance initializer
|
||||
DependencyParser.parseDependenciesFromMethodInfo(null, scriptIndex, class_info, false, customNs, abc, instanceInfo.iinit_index, dependencies, packageName, fullyQualifiedNames, new ArrayList<>());
|
||||
DependencyParser.parseDependenciesFromMethodInfo(abcIndex, null, scriptIndex, class_info, false, customNs, abc, instanceInfo.iinit_index, dependencies, packageName, fullyQualifiedNames, new ArrayList<>());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -133,14 +133,14 @@ public class TraitFunction extends Trait implements TraitWithSlot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDependencies(int scriptIndex, int classIndex, boolean isStatic, String customNs, ABC abc, List<Dependency> dependencies, DottedChain ignorePackage, List<DottedChain> fullyQualifiedNames) throws InterruptedException {
|
||||
public void getDependencies(AbcIndexing abcIndex, int scriptIndex, int classIndex, boolean isStatic, String customNs, ABC abc, List<Dependency> dependencies, DottedChain ignorePackage, List<DottedChain> fullyQualifiedNames) throws InterruptedException {
|
||||
if (ignorePackage == null) {
|
||||
ignorePackage = getPackage(abc);
|
||||
}
|
||||
super.getDependencies(scriptIndex, classIndex, false, customNs, abc, dependencies, ignorePackage, fullyQualifiedNames);
|
||||
super.getDependencies(abcIndex, scriptIndex, classIndex, false, customNs, abc, dependencies, ignorePackage, fullyQualifiedNames);
|
||||
//if (method_info != 0)
|
||||
{
|
||||
DependencyParser.parseDependenciesFromMethodInfo(this, scriptIndex, classIndex, false, customNs, abc, method_info, dependencies, ignorePackage, fullyQualifiedNames, new ArrayList<>());
|
||||
DependencyParser.parseDependenciesFromMethodInfo(abcIndex, this, scriptIndex, classIndex, false, customNs, abc, method_info, dependencies, ignorePackage, fullyQualifiedNames, new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,11 +63,11 @@ public class TraitMethodGetterSetter extends Trait {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDependencies(int scriptIndex, int classIndex, boolean isStatic, String customNs, ABC abc, List<Dependency> dependencies, DottedChain ignorePackage, List<DottedChain> fullyQualifiedNames) throws InterruptedException {
|
||||
public void getDependencies(AbcIndexing abcIndex, int scriptIndex, int classIndex, boolean isStatic, String customNs, ABC abc, List<Dependency> dependencies, DottedChain ignorePackage, List<DottedChain> fullyQualifiedNames) throws InterruptedException {
|
||||
if (ignorePackage == null) {
|
||||
ignorePackage = getPackage(abc);
|
||||
}
|
||||
super.getDependencies(scriptIndex, classIndex, isStatic, customNs, abc, dependencies, ignorePackage, fullyQualifiedNames);
|
||||
super.getDependencies(abcIndex, scriptIndex, classIndex, isStatic, customNs, abc, dependencies, ignorePackage, fullyQualifiedNames);
|
||||
|
||||
if (customNs == null) {
|
||||
Namespace n = getName(abc).getNamespace(abc.constants);
|
||||
@@ -77,7 +77,7 @@ public class TraitMethodGetterSetter extends Trait {
|
||||
}
|
||||
//if (method_info != 0)
|
||||
{
|
||||
DependencyParser.parseDependenciesFromMethodInfo(this, scriptIndex, classIndex, isStatic, customNs, abc, method_info, dependencies, ignorePackage, fullyQualifiedNames, new ArrayList<>());
|
||||
DependencyParser.parseDependenciesFromMethodInfo(abcIndex, this, scriptIndex, classIndex, isStatic, customNs, abc, method_info, dependencies, ignorePackage, fullyQualifiedNames, new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -221,12 +221,12 @@ public class TraitSlotConst extends Trait implements TraitWithSlot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDependencies(int scriptIndex, int classIndex, boolean isStatic, String customNs, ABC abc, List<Dependency> dependencies, DottedChain ignorePackage, List<DottedChain> fullyQualifiedNames) throws InterruptedException {
|
||||
public void getDependencies(AbcIndexing abcIndex, int scriptIndex, int classIndex, boolean isStatic, String customNs, ABC abc, List<Dependency> dependencies, DottedChain ignorePackage, List<DottedChain> fullyQualifiedNames) throws InterruptedException {
|
||||
if (ignorePackage == null) {
|
||||
ignorePackage = getPackage(abc);
|
||||
}
|
||||
super.getDependencies(scriptIndex, classIndex, isStatic, customNs, abc, dependencies, ignorePackage, fullyQualifiedNames);
|
||||
DependencyParser.parseDependenciesFromMultiname(customNs, abc, dependencies, abc.constants.getMultiname(type_index), getPackage(abc), fullyQualifiedNames, DependencyType.SIGNATURE);
|
||||
super.getDependencies(abcIndex, scriptIndex, classIndex, isStatic, customNs, abc, dependencies, ignorePackage, fullyQualifiedNames);
|
||||
DependencyParser.parseDependenciesFromMultiname(abcIndex, customNs, abc, dependencies, abc.constants.getMultiname(type_index), getPackage(abc), fullyQualifiedNames, DependencyType.SIGNATURE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -298,9 +298,9 @@ public class Traits implements Cloneable, Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
public void getDependencies(int scriptIndex, int classIndex, boolean isStatic, String customNs, ABC abc, List<Dependency> dependencies, DottedChain ignorePackage, List<DottedChain> fullyQualifiedNames) throws InterruptedException {
|
||||
public void getDependencies(AbcIndexing abcIndex, int scriptIndex, int classIndex, boolean isStatic, String customNs, ABC abc, List<Dependency> dependencies, DottedChain ignorePackage, List<DottedChain> fullyQualifiedNames) throws InterruptedException {
|
||||
for (Trait t : traits) {
|
||||
t.getDependencies(scriptIndex, classIndex, isStatic, customNs, abc, dependencies, ignorePackage, fullyQualifiedNames);
|
||||
t.getDependencies(abcIndex, scriptIndex, classIndex, isStatic, customNs, abc, dependencies, ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user