- public JS callMethod(JS method, JS[] args) throws JSExn {
+ public JS call(JS method, JS[] args) throws JSExn {
+ String s = coerceToString();
+ int slength = s.length();
+
//#switch(JSU.str(method))
case "toFixed": throw new JSExn("toFixed() not implemented");
case "toExponential": throw new JSExn("toExponential() not implemented");
case "toPrecision": throw new JSExn("toPrecision() not implemented");
case "toString": return this instanceof JSString ? this : JSU.S(JSU.toString(this));
//#switch(JSU.str(method))
case "toFixed": throw new JSExn("toFixed() not implemented");
case "toExponential": throw new JSExn("toExponential() not implemented");
case "toPrecision": throw new JSExn("toPrecision() not implemented");
case "toString": return this instanceof JSString ? this : JSU.S(JSU.toString(this));
case "substring": {
int a = args.length >= 1 ? JSU.toInt(args[0]) : 0;
int b = args.length >= 2 ? JSU.toInt(args[1]) : slength;
case "substring": {
int a = args.length >= 1 ? JSU.toInt(args[0]) : 0;
int b = args.length >= 2 ? JSU.toInt(args[1]) : slength;