AS1/2 ActionTry fix

AS1/2 Infinity
This commit is contained in:
Jindra Petk
2013-04-04 21:34:23 +02:00
parent 11da7d8c68
commit c5edeeb3fb
21 changed files with 1039 additions and 958 deletions

View File

@@ -61,30 +61,28 @@ public class DirectValueTreeItem extends TreeItem {
if (value instanceof Boolean) {
return ((Boolean) value) ? 1 : 0;
}
if (value instanceof String) {
String s=(String) value;
if(s.length()==1){
String s = (String) value;
if (s.length() == 1) {
return s.charAt(0);
}
double ret=0.0;
try{
ret=Double.parseDouble(s);
}catch(NumberFormatException nex){
double ret = 0.0;
try {
ret = Double.parseDouble(s);
} catch (NumberFormatException nex) {
}
return ret;
}
if (value instanceof ConstantIndex) {
String s=(this.constants.get(((ConstantIndex) value).index));
if(s.length()==1){
String s = (this.constants.get(((ConstantIndex) value).index));
if (s.length() == 1) {
return s.charAt(0);
}
double ret=0.0;
try{
ret=Double.parseDouble(s);
}catch(NumberFormatException nex){
double ret = 0.0;
try {
ret = Double.parseDouble(s);
} catch (NumberFormatException nex) {
}
return ret;
}
@@ -109,16 +107,16 @@ public class DirectValueTreeItem extends TreeItem {
return ((Long) value) != 0;
}
if (value instanceof String) {
String s=(String) value;
if(s.length()==1){
return toNumber()==0;
String s = (String) value;
if (s.length() == 1) {
return toNumber() == 0;
}
return !s.equals("");
}
if (value instanceof ConstantIndex) {
String s=(this.constants.get(((ConstantIndex) value).index));
if(s.length()==1){
return toNumber()==0;
String s = (this.constants.get(((ConstantIndex) value).index));
if (s.length() == 1) {
return toNumber() == 0;
}
return !s.equals("");
}
@@ -189,9 +187,7 @@ public class DirectValueTreeItem extends TreeItem {
@Override
public boolean isCompileTime() {
return (value instanceof Double) || (value instanceof Float) || (value instanceof Boolean) || (value instanceof Long) || (value instanceof Null) || (computedRegValue != null && computedRegValue.isCompileTime())
//||(value instanceof String) || (value instanceof ConstantIndex)
return (value instanceof Double) || (value instanceof Float) || (value instanceof Boolean) || (value instanceof Long) || (value instanceof Null) || (computedRegValue != null && computedRegValue.isCompileTime()) //||(value instanceof String) || (value instanceof ConstantIndex)
;
}
}