fixed bug 403, added logging to tcp and email
[org.ibex.core.git] / src / org / ibex / js / Interpreter.java
index 1b679ca..59b48c3 100644 (file)
@@ -93,7 +93,9 @@ 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: if (!JS.toBoolean(stack.pop())) throw je("ibex.assertion.failed" /*FEATURE: line number*/); break;
+            case ASSERT:
+                if (JS.checkAssertions && !JS.toBoolean(stack.pop()))
+                    throw je("ibex.assertion.failed" /*FEATURE: line number*/); 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;
@@ -555,7 +557,7 @@ class Interpreter implements ByteCodes, Tokens {
         public CallMarker(Interpreter cx) { pc = cx.pc + 1; scope = cx.scope; f = cx.f; }
     }
     
-    public static class CatchMarker { public CatchMarker() { } }
+    public static class CatchMarker { }
     private static CatchMarker catchMarker = new CatchMarker();
     
     public static class LoopMarker {