String coerceToString() { return date_format(date, FORMATSPEC_FULL); }
- public JS callMethod(JS method_, JS a0, JS a1, JS a2, JS[] rest, int nargs) throws JSExn {
- if(!JS.isString(method_)) return super.callMethod(method_, a0, a1, a2, rest, nargs);
- String method = JS.toString(method_);
+ public JS callMethod(JS method, JS a0, JS a1, JS a2, JS[] rest, int nargs) throws JSExn {
switch(nargs) {
case 0: {
- //#switch(method)
+ //#jswitch(method)
case "toString": return JS.S(date_format(date, FORMATSPEC_FULL));
case "toTimeString": return JS.S(date_format(date, FORMATSPEC_TIME));
case "toDateString": return JS.S(date_format(date, FORMATSPEC_DATE));
case "getUTCMilliseconds": return N(msFromTime(date));
case "getTimezoneOffset": return N(getTimezoneOffset(date));
//#end
- return super.callMethod(method_, a0, a1, a2, rest, nargs);
+ return super.callMethod(method, a0, a1, a2, rest, nargs);
}
case 1: {
- //#switch(method)
+ //#jswitch(method)
case "setTime": return N(this.setTime(toDouble(a0)));
case "setYear": return N(this.setYear(toDouble(a0)));
//#end
default: {
JS[] args = new JS[nargs];
for(int i=0; i<nargs; i++) args[i] = i==0 ? a0 : i==1 ? a1 : i==2 ? a2 : rest[i-3];
- //#switch(method)
+ //#jswitch(method)
case "setMilliseconds": return N(this.makeTime(args, 1, true));
case "setUTCMilliseconds": return N(this.makeTime(args, 1, false));
case "setSeconds": return N(this.makeTime(args, 2, true));
//#end
}
}
- return super.callMethod(method_, a0, a1, a2, rest, nargs);
+ return super.callMethod(method, a0, a1, a2, rest, nargs);
}
- public JS get(JS key_) throws JSExn {
- if(!JS.isString(key_)) return super.get(key_);
- String key = JS.toString(key_);
- //#switch(key)
+ public JS get(JS key) throws JSExn {
+ //#jswitch(key)
case "toString": return METHOD;
case "toTimeString": return METHOD;
case "toDateString": return METHOD;
case "setFullYear": return METHOD;
case "setUTCFullYear": return METHOD;
//#end
- return super.get(key_);
+ return super.get(key);
}
/* ECMA helper functions */