ecmascript and push byte fix

This commit is contained in:
honfika@gmail.com
2015-11-16 11:09:49 +01:00
parent 07729800c9
commit 722c4fae24
4 changed files with 47 additions and 3 deletions

View File

@@ -48,8 +48,13 @@ public class EcmaScript {
return (double) (int) (Integer) o;
}
if (o instanceof String) {
String str = (String) o;
if (str.isEmpty()) {
return 0.0;
}
try {
return Double.parseDouble((String) o);
return Double.parseDouble(str);
} catch (NumberFormatException nfe) {
return Double.NaN;
}