mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-06 13:45:57 +00:00
Fixed #1840 AS3 - Allow to compile object literal keys with nonstring/numbers in obfuscated code
This commit is contained in:
@@ -46,8 +46,15 @@ public class NameValuePair extends AVM2Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
boolean needsParents = !((name.getNotCoerced() instanceof NumberValueAVM2Item) || (name.getNotCoerced() instanceof StringAVM2Item)); // special for obfuscated strings
|
||||
if (needsParents) {
|
||||
writer.append("(");
|
||||
}
|
||||
name.toStringString(writer, localData);
|
||||
if (needsParents) {
|
||||
writer.append(")");
|
||||
}
|
||||
writer.append(":");
|
||||
if (value instanceof TernarOpItem) { //Ternar operator contains ":"
|
||||
writer.append("(");
|
||||
|
||||
@@ -2351,10 +2351,15 @@ public class ActionScript3Parser {
|
||||
lexer.pushback(s);
|
||||
}
|
||||
s = lex();
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER, SymbolType.STRING, SymbolType.INTEGER, SymbolType.DOUBLE);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER, SymbolType.STRING, SymbolType.INTEGER, SymbolType.DOUBLE, SymbolType.PARENT_OPEN);
|
||||
|
||||
GraphTargetItem n = new StringAVM2Item(null, null, s.value.toString());
|
||||
//expression(allOpenedNamespaces, thisType,pkg,needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, allowRemainder, variables);
|
||||
GraphTargetItem n;
|
||||
if (s.type == SymbolType.PARENT_OPEN) { //special for obfuscated SWFs
|
||||
n = expression(allOpenedNamespaces, thisType,pkg,needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, allowRemainder, variables, false);
|
||||
expectedType(SymbolType.PARENT_CLOSE);
|
||||
} else {
|
||||
n = new StringAVM2Item(null, null, s.value.toString());
|
||||
}
|
||||
expectedType(SymbolType.COLON);
|
||||
GraphTargetItem v = expression(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, allowRemainder, variables, false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user