updated Makefile.common
[org.ibex.core.git] / src / org / ibex / js / JSDate.java
index 600b59d..144e868 100644 (file)
@@ -57,12 +57,10 @@ public class JSDate extends JS {
 
     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));
@@ -91,10 +89,10 @@ public class JSDate extends JS {
                 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
@@ -103,7 +101,7 @@ public class JSDate extends JS {
             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));
@@ -121,13 +119,11 @@ public class JSDate extends JS {
                 //#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;
@@ -172,7 +168,7 @@ public class JSDate extends JS {
         case "setFullYear": return METHOD;
         case "setUTCFullYear": return METHOD;
         //#end
-        return super.get(key_);
+        return super.get(key);
     }
 
     /* ECMA helper functions */