get rid of JS.BT
[org.ibex.core.git] / src / org / ibex / js / JSScope.java
index f7d3d6d..9fbd3e2 100644 (file)
@@ -3,8 +3,7 @@ package org.ibex.js;
 
 // FIXME: should allow parentScope to be a JS, not a JSScope
 /** Implementation of a JavaScript Scope */
-// HACK: JSScope doesn't really need the BT, this is just for Box.java 
-public class JSScope extends JS.BT { 
+public class JSScope extends JS.O { 
 
     private JSScope parentScope;
 
@@ -50,8 +49,7 @@ public class JSScope extends JS.BT {
         }
         
         public JS _get(JS key) throws JSExn {
-            if(!JS.isString(key)) return super.get(key);
-            //#switch(JS.toString(key))
+            //#jswitch(key)
             case "NaN": return NaN;
             case "Infinity": return POSITIVE_INFINITY;
             case "undefined": return null;
@@ -71,8 +69,7 @@ public class JSScope extends JS.BT {
         }
 
         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);
-            //#switch(JS.toString(method))
+            //#jswitch(method)
             case "parseInt": return parseInt(a0, N(0));
             case "parseFloat": return parseFloat(a0);
             case "isNaN": { double d = toDouble(a0); return d == d ? F : T; }