X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjs%2FInterpreter.java;h=0d2c21905ef06b8b2bf7615d6ff9f75386f0ff98;hp=6fc2859c30fe596b45c8625f83cb16a288f2ece2;hb=29d34750ad40b2addfbc5f20cdab3d4accac157e;hpb=efb8222281235696686fd094844e1d2dcab916ae diff --git a/src/org/ibex/js/Interpreter.java b/src/org/ibex/js/Interpreter.java index 6fc2859..0d2c219 100644 --- a/src/org/ibex/js/Interpreter.java +++ b/src/org/ibex/js/Interpreter.java @@ -218,25 +218,24 @@ class Interpreter implements ByteCodes, Tokens { Trap t = null; if (target instanceof JSScope && key.equals("cascade")) { - Trap.TrapScope ts = null; + Trap.TrapScope ts = null; JSScope p = (JSScope)target; // search the scope-path for the trap - if (target instanceof Trap.TrapScope) { + if (target instanceof Trap.TrapScope) { ts = (Trap.TrapScope)target; - } - else { - while (ts == null && p.getParentScope() != null) { - p = p.getParentScope(); - if (p instanceof Trap.TrapScope) { - ts = (Trap.TrapScope)p; - } - } - } - t = ts.t.next; - ts.cascadeHappened = true; - while (t != null && t.f.numFormalArgs == 0) t = t.next; - if (t == null) { target = ts.t.trapee; key = ts.t.name; } - - } else if (target instanceof JS) { + } else { + while (ts == null && p.getParentScope() != null) { + p = p.getParentScope(); + if (p instanceof Trap.TrapScope) ts = (Trap.TrapScope)p; + } + } + if(ts != null) { + t = ts.t.next; + ts.cascadeHappened = true; + while (t != null && t.f.numFormalArgs == 0) t = t.next; + if (t == null) { target = ts.t.trapee; key = ts.t.name; } + } + } + if(t == null) { if (target instanceof JSScope) { JSScope p = (JSScope)target; // search the scope-path for the trap t = p.getTrap(key);