- /** Called by Rhino's arguments.cascade. Note: cx will be null if this was invoked from perform() rather than from a script. */
- public static final JS.Callable cascadeFunction = new JS.Callable() {
- public Object call(JS.Array args) {
- Trap currentTrap = TrapContext.get().currentTrap;
- if (args.length() != 0) TrapContext.get().putCascadeHappened = true;
- Trap t = currentTrap.next;
- // if we've hit the end of the trap stack, just do a put(,,,true)
- if (t == null) {
- if (args.length() == 0) return currentTrap.trapee.get(currentTrap.name, true);
- currentTrap.trapee.put(currentTrap.name, args.elementAt(0), true);
- return null;
- }
- return t.perform(args);
- }
- };
-