- returnedFromJava = ((JS)target).put(key, val);
- if (returnedFromJava != null) checkReturnedFromJava = true;
- else cx.stack.push(val);
+ JSTrap t = null;
+ if (o instanceof JSTrap.JSTrappable) {
+ t = ((JSTrap.JSTrappable)o).getTrap(v);
+ while (t != null && t.f.numFormalArgs == 0) t = t.next;
+ } else if (o instanceof JSTrap.JSTrapScope && key.equals("cascade")) {
+ JSTrap.JSTrapScope ts = (JSTrap.JSTrapScope)o;
+ t = ts.t.next;
+ ts.cascadeHappened = true;
+ while (t != null && t.f.numFormalArgs == 0) t = t.next;
+ if (t == null) o = ts.t.trappee;
+ }
+ if (t != null) {
+ cx.stack.push(new CallMarker(cx));
+ JSArray args = new JSArray();
+ args.addElement(val);
+ cx.stack.push(ta);
+ cx.f = t.f;
+ cx.scope = new JSTrap.JSTrapScope(cx.f.parentJSScope, val);
+ cx.pc = -1;
+ break;
+ }
+ ((JS)target).put(key, val);
+ if (cx.pausecount > initialPauseCount) return; // we were paused
+ cx.stack.push(val);