trim down public api
[org.ibex.core.git] / src / org / ibex / js / Interpreter.java
index 6f163fa..83ff539 100644 (file)
@@ -99,12 +99,7 @@ class Interpreter implements ByteCodes, Tokens {
             case DUP: stack.push(stack.peek()); break;
             case NEWSCOPE: scope = new JSScope(scope); break;
             case OLDSCOPE: scope = scope.getParentScope(); break;
-            case ASSERT: {
-                JS o = stack.pop();
-                if (JS.checkAssertions && !JS.toBoolean(o))
-                    throw je("ibex.assertion.failed");
-                break;
-            }
+            case ASSERT: if (!JS.toBoolean(stack.pop())) throw je("ibex.assertion.failed"); break;
             case BITNOT: stack.push(JS.N(~JS.toLong(stack.pop()))); break;
             case BANG: stack.push(JS.B(!JS.toBoolean(stack.pop()))); break;
             case NEWFUNCTION: stack.push(((JSFunction)arg)._cloneWithNewParentScope(scope)); break;
@@ -614,13 +609,11 @@ class Interpreter implements ByteCodes, Tokens {
             super(parent); this.t = t;
         }
         public JS get(JS key) throws JSExn {
-            if(JS.isString(key)) {
-                //#switch(JS.toString(key))
-                case "trapee": return t.target;
-                case "callee": return t.f;
-                case "trapname": return t.key;
-                //#end
-            }
+            //#jswitch(key)
+            case "trapee": return t.target;
+            case "callee": return t.f;
+            case "trapname": return t.key;
+            //#end
             return super.get(key);
         }
     }
@@ -651,7 +644,7 @@ class Interpreter implements ByteCodes, Tokens {
                     default: return n>= 0 && n < nargs ? rest[n-3] : null;
                 }
             }
-            //#switch(JS.toString(key))
+            //#jswitch(key)
             case "callee": return callee;
             case "length": return JS.N(nargs);
             //#end