@SuppressWarnings("unused")
private static Double toDouble(final Object obj0) {
// TODO - Order tests for performance.
for (Object obj = obj0; ;) {
if (obj == null) {
return null;
} else if (obj instanceof Double) {
return (Double) obj;
} else if (obj instanceof Number) {
return ((Number)obj).doubleValue();
} else if (obj instanceof String) {
return JSType.toNumber((String) obj);
} else if (obj instanceof ConsString) {
return JSType.toNumber(obj.toString());
} else if (obj instanceof Boolean) {
return (Boolean) obj ? 1 : +0.0;
} else if (obj instanceof ScriptObject) {
obj = JSType.toPrimitive(obj, Number.class);
continue;
} else if (obj == UNDEFINED) {
return Double.NaN;
}
throw assertUnexpectedType(obj);
}
}
JavaArgumentConverters.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:openjdk9
作者:
评论列表
文章目录