X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjs%2FInterpreter.java;h=83ff5397123ed62fd3c182014ade2706ffbfcb80;hp=6f163fabc7fc4831b7fa7d348baaf589e8ed70fa;hb=a19b897271a8ab6b25aba63e4b30223c2477c28d;hpb=0e9197be8053d1e3bc8699a8f527d34850024cd7 diff --git a/src/org/ibex/js/Interpreter.java b/src/org/ibex/js/Interpreter.java index 6f163fa..83ff539 100644 --- a/src/org/ibex/js/Interpreter.java +++ b/src/org/ibex/js/Interpreter.java @@ -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