Checking in patch from Stefan Matthias Aust for default value support in getProperty().

This commit is contained in:
hns 2003-07-28 09:56:10 +00:00
parent 5e8b1aebad
commit e55c0e05c2

View file

@ -142,11 +142,16 @@ public class GlobalObject extends ScriptableObject {
* *
* *
* @param propname ... * @param propname ...
* @param defvalue ...
* *
* @return ... * @return ...
*/ */
public String getProperty(String propname) { public String getProperty(String propname, Object defvalue) {
return app.getProperty(propname); if (defvalue == Undefined.instance) {
return app.getProperty(propname);
} else {
return app.getProperty(propname, defvalue.toString());
}
} }
/** /**