mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-15 18:01:51 +00:00
Changed AS1/2/3 P-code - format Number values with EcmaScript toString function
This commit is contained in:
@@ -31,6 +31,7 @@ import com.jpexs.decompiler.flash.abc.types.Float4;
|
||||
import com.jpexs.decompiler.flash.abc.types.MethodBody;
|
||||
import com.jpexs.decompiler.flash.abc.types.Multiname;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
import com.jpexs.decompiler.graph.GraphSource;
|
||||
@@ -327,7 +328,7 @@ public class AVM2Instruction implements Cloneable, GraphSourceItem {
|
||||
} else {
|
||||
s.append(" ");
|
||||
try {
|
||||
s.append(constants.getDouble(operands[i]));
|
||||
s.append(EcmaScript.toString(constants.getDouble(operands[i])));
|
||||
} catch (IndexOutOfBoundsException iob) {
|
||||
s.append("Unknown(").append(operands[i]).append(")");
|
||||
}
|
||||
@@ -339,7 +340,7 @@ public class AVM2Instruction implements Cloneable, GraphSourceItem {
|
||||
} else {
|
||||
s.append(" ");
|
||||
try {
|
||||
s.append(constants.getFloat(operands[i]));
|
||||
s.append(EcmaScript.toString(constants.getFloat(operands[i])));
|
||||
} catch (IndexOutOfBoundsException iob) {
|
||||
s.append("Unknown(").append(operands[i]).append(")");
|
||||
}
|
||||
@@ -351,10 +352,10 @@ public class AVM2Instruction implements Cloneable, GraphSourceItem {
|
||||
} else {
|
||||
try {
|
||||
Float4 f4 = constants.getFloat4(operands[i]);
|
||||
s.append(" ").append(f4.values[0]);
|
||||
s.append(" ").append(f4.values[1]);
|
||||
s.append(" ").append(f4.values[2]);
|
||||
s.append(" ").append(f4.values[3]);
|
||||
s.append(" ").append(EcmaScript.toString(f4.values[0]));
|
||||
s.append(" ").append(EcmaScript.toString(f4.values[1]));
|
||||
s.append(" ").append(EcmaScript.toString(f4.values[2]));
|
||||
s.append(" ").append(EcmaScript.toString(f4.values[3]));
|
||||
} catch (IndexOutOfBoundsException iob) {
|
||||
s.append(" Unknown(").append(operands[i]).append(")");
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ public class ValueKind {
|
||||
ret = "UInteger(" + constants.getUInt(value_index) + ")";
|
||||
break;
|
||||
case CONSTANT_Double:
|
||||
ret = "Double(" + constants.getDouble(value_index) + ")";
|
||||
ret = "Double(" + EcmaScript.toString(constants.getDouble(value_index)) + ")";
|
||||
break;
|
||||
case CONSTANT_DecimalOrFloat:
|
||||
ret = "Decimal(" + constants.getDecimal(value_index) + ")";
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.jpexs.decompiler.flash.action.parser.pcode.ASMParsedSymbol;
|
||||
import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.dumpview.DumpInfo;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.ecma.Null;
|
||||
import com.jpexs.decompiler.flash.ecma.Undefined;
|
||||
import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
|
||||
@@ -346,6 +347,8 @@ public class ActionPush extends Action {
|
||||
ret = "\"" + Helper.escapeActionScriptString((String) value) + "\"";
|
||||
} else if (value instanceof RegisterNumber) {
|
||||
ret = ((RegisterNumber) value).toStringNoName();
|
||||
} else if ((value instanceof Float)||(value instanceof Double)) {
|
||||
ret = EcmaScript.toString(value);
|
||||
} else {
|
||||
ret = value.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user