projects
/
org.ibex.core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new js api
[org.ibex.core.git]
/
src
/
org
/
ibex
/
js
/
Trap.java
diff --git
a/src/org/ibex/js/Trap.java
b/src/org/ibex/js/Trap.java
index
77476f6
..
248ae6a
100644
(file)
--- a/
src/org/ibex/js/Trap.java
+++ b/
src/org/ibex/js/Trap.java
@@
-10,12
+10,12
@@
package org.ibex.js;
class Trap {
JS trapee = null; ///< the box on which this trap was placed
class Trap {
JS trapee = null; ///< the box on which this trap was placed
- Object name = null; ///< the property that the trap was placed on
+ JS name = null; ///< the property that the trap was placed on
JSFunction f = null; ///< the function for this trap
Trap next = null; ///< the next trap down the trap stack
JSFunction f = null; ///< the function for this trap
Trap next = null; ///< the next trap down the trap stack
- Trap(JS b, String n, JSFunction f, Trap nx) {
+ Trap(JS b, JS n, JSFunction f, Trap nx) {
trapee = b; name = n; this.f = f; this.next = nx;
}
trapee = b; name = n; this.f = f; this.next = nx;
}
@@
-29,7
+29,10
@@
class Trap {
getInvoker.add(2, Tokens.RETURN, null);
}
getInvoker.add(2, Tokens.RETURN, null);
}
- void invoke(Object value) throws JSExn {
+ boolean readTrap() { return f.numFormalArgs == 0; }
+ boolean writeTrap() { return f.numFormalArgs != 0; }
+
+ void invoke(JS value) throws JSExn {
Interpreter i = new Interpreter(putInvoker, false, null);
i.stack.push(trapee);
i.stack.push(name);
Interpreter i = new Interpreter(putInvoker, false, null);
i.stack.push(trapee);
i.stack.push(name);
@@
-37,7
+40,7
@@
class Trap {
i.resume();
}
i.resume();
}
- Object invoke() throws JSExn {
+ JS invoke() throws JSExn {
Interpreter i = new Interpreter(getInvoker, false, null);
i.stack.push(trapee);
i.stack.push(name);
Interpreter i = new Interpreter(getInvoker, false, null);
i.stack.push(trapee);
i.stack.push(name);
@@
-45,7
+48,7
@@
class Trap {
}
// FIXME: review; is necessary?
}
// FIXME: review; is necessary?
- static class TrapScope extends JSScope {
+ /*static class TrapScope extends JSScope {
Trap t;
Object val = null;
boolean cascadeHappened = false;
Trap t;
Object val = null;
boolean cascadeHappened = false;
@@
-56,6
+59,6
@@
class Trap {
if (key.equals("trapname")) return t.name;
return super.get(key);
}
if (key.equals("trapname")) return t.name;
return super.get(key);
}
- }
+ }*/
}
}