Do not needlessly convert scriptable to string in put().

This commit is contained in:
hns 2003-06-13 15:42:10 +00:00
parent 4d419c3a46
commit 84eac337cf

View file

@ -454,8 +454,10 @@ public class HopObject extends ScriptableObject {
if ("Date".equals(s.getClassName())) {
node.setDate(name, new Date((long) ScriptRuntime.toNumber(s)));
} else if (s instanceof MapWrapper) {
node.setJavaObject(name, ((MapWrapper) s).unwrap());
} else {
node.setString(name, s.toString());
node.setJavaObject(name, s);
}
} else if (value instanceof String) {
node.setString(name, value.toString());
@ -536,7 +538,7 @@ public class HopObject extends ScriptableObject {
if (node != null) {
// Everything starting with an underscore is interpreted as internal property
if (name.startsWith("_")) {
if (name.charAt(0) == '_') {
return getInternalProperty(name);
}