mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-30 20:27:44 +00:00
AS1/2 Delete operator with nonIdentifier parameters (e.g. spaces or obfuscated)
This commit is contained in:
@@ -12,9 +12,11 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.IdentifiersDeobfuscation;
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionDelete;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionDelete2;
|
||||
@@ -55,12 +57,25 @@ public class DeleteActionItem extends ActionItem {
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
writer.append("delete ");
|
||||
writer.append("delete ");
|
||||
if (object == null) {
|
||||
if (object != null) {
|
||||
object.toStringNoQuotes(writer, localData);
|
||||
if (IdentifiersDeobfuscation.isValidName(false, propertyName.toStringNoQuotes(localData))) {
|
||||
writer.append(".");
|
||||
propertyName.toStringNoQuotes(writer, localData);
|
||||
} else {
|
||||
writer.append("[");
|
||||
propertyName.toString(writer, localData);
|
||||
writer.append("]");
|
||||
}
|
||||
return writer;
|
||||
}
|
||||
}
|
||||
object.toStringNoQuotes(writer, localData);
|
||||
writer.append(".");
|
||||
|
||||
if (IdentifiersDeobfuscation.isValidName(false, propertyName.toStringNoQuotes(localData))) {
|
||||
propertyName.toStringNoQuotes(writer, localData);
|
||||
} else {
|
||||
propertyName.toString(writer, localData);
|
||||
}
|
||||
return writer;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -606,6 +606,8 @@ public class ActionScript2Parser {
|
||||
} else if (varDel instanceof VariableActionItem) {
|
||||
variables.remove(varDel);
|
||||
ret = new DeleteActionItem(null, null, null, pushConst(((VariableActionItem) varDel).getVariableName()));
|
||||
} else if (varDel instanceof DirectValueActionItem) {
|
||||
ret = new DeleteActionItem(null, null, null, varDel);
|
||||
} else {
|
||||
throw new ActionParseException("Not a property", lexer.yyline());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user