public static Object stringReplace(Object o, Object arg0, Object arg1) throws JSExn {
String s = o.toString();
RE re;
- JS replaceFunc = null;
+ JSFunction replaceFunc = null;
String replaceString = null;
JSRegexp regexp = null;
if(arg0 instanceof JSRegexp) {
} else {
re = newRE(arg0.toString(),0);
}
- if(arg1 instanceof JS)
- replaceFunc = (JS) arg1;
+ if(arg1 instanceof JSFunction)
+ replaceFunc = (JSFunction) arg1;
else
- replaceString = arg1.toString();
+ replaceString = JS.toString(arg1.toString());
REMatch[] matches;
if(regexp != null && regexp.global) {
matches = re.getAllMatches(s);