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 defvalue ...
*
* @return ...
*/
public String getProperty(String propname) {
return app.getProperty(propname);
public String getProperty(String propname, Object defvalue) {
if (defvalue == Undefined.instance) {
return app.getProperty(propname);
} else {
return app.getProperty(propname, defvalue.toString());
}
}
/**