// Static Data //////////////////////////////////////////////////////////////
- private static JS.CompiledFunction cascadeHelper = null;
+ private static Function cascadeHelper = null;
private static String cascadeHelperText =
"return function(q) { var ret = arguments.doTrap;" +
"if (ret != false && !arguments.didCascade) arguments.cascade = q; };";
static {
try {
cascadeHelper = JS.parse("cascadeHelper", 1, new StringReader(cascadeHelperText));
- cascadeHelper = (JS.CompiledFunction)new JS.Context(cascadeHelper, null, null).resume(null);
+ cascadeHelper = (Function)new JS.Context(cascadeHelper, null).resume();
} catch (Exception e) {
Log.log(Trap.class, e);
}
private Box trapee = null;
/** the function for this trap */
- JS.CompiledFunction f = null;
+ Function f = null;
/** the next trap down the trap stack */
private Trap next = null;
* @param name the name of the property to trap on
* @param f the function to place as a trap
*/
- static void addTrap(Box trapee, Object name, JS.CompiledFunction f) {
+ static void addTrap(Box trapee, Object name, Function f) {
// check if this script has already placed a trap on this property
for(Trap t = (Trap)trapee.get(name, Trap.class); t != null; t = t.next)
* @param name the name of the property to trap on
* @param f the function to remove
*/
- static void delTrap(Box trapee, Object name, JS.CompiledFunction f) {
+ static void delTrap(Box trapee, Object name, Function f) {
Trap t = (Trap)trapee.get(name, Trap.class);
if (t.f == f) { trapee.put2(name, Trap.class, t.next); return; }
for(; t.next != null; t = t.next)
// Instance Methods //////////////////////////////////////////////////////////////////////////
- private Trap(Box b, String n, JS.CompiledFunction f, Trap nx)
+ private Trap(Box b, String n, Function f, Trap nx)
{ trapee = b; name = n; this.f = f; this.next = nx; }
// Read Traps //////////////////////////////////////////////////////////////////////