Checking in patch from Stefan Matthias Aust for default value support in getProperty().
This commit is contained in:
parent
5e8b1aebad
commit
e55c0e05c2
1 changed files with 7 additions and 2 deletions
|
@ -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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue