static Hash imageToNameMap = new Hash();
/** the empty object, used for get-traps */
- private static Array emptyobj = new Array();
+ private static JS.Array emptyobj = new JS.Array();
// Instance Data: Templates ////////////////////////////////////////////////////////
/** a trivial private class to serve as the box.indexof function object */
private class IndexOf extends JS.Callable {
public IndexOf() { this.setSeal(true); }
- public Object call(Array args) throws JS.Exn {
+ public Object call(JS.Array args) throws JS.Exn {
if (args.length() != 1 || args.elementAt(0) == null || !(args.elementAt(0) instanceof Box)) return new Integer(-1);
Box b = (Box)args.elementAt(0);
if (b.getParent() != Box.this) {
if (clear && callback != null) {
clear = false;
ThreadMessage.newthread(new JS.Callable() {
- public Object call(Array args_) throws JS.Exn {
+ public Object call(JS.Array args_) throws JS.Exn {
try {
- Array args = new Array();
+ JS.Array args = new JS.Array();
args.addElement(new Double(bytesDownloaded));
args.addElement(new Double(contentLength));
callback.call(args);
if (!ignoretraps && traps != null) {
Trap t = (Trap)traps.get(name);
if (t != null) {
- Array arg = new Array();
+ JS.Array arg = new JS.Array();
arg.addElement(value);
t.perform(arg);
arg.setElementAt(null, 0);
if (name.charAt(0) == '_') {
if (value != null && !(value instanceof JS.Callable)) {
- if (Log.on) Log.log(this, "attempt to put a non-function value (" + value + ") to " +
+ if (Log.on) Log.log(this, "attempt to put a non function value (" + value + ") to " +
+ name + " at " + Context.getCurrentSourceNameAndLine());
+ } else if (value != null && !(value instanceof JS.CompiledFunction)) {
+ if (Log.on) Log.log(this, "attempt to put a non-compiled function value (" + value + ") to " +
name + " at " + Context.getCurrentSourceNameAndLine());
} else if (name.charAt(1) == '_') {
name = name.substring(2).intern();
Trap t = Trap.getTrap(this, name);
if (t != null) t.delete();
- if (value != null) Trap.addTrap(this, name, ((CompiledFunction)value), true, rp);
+ if (value != null) Trap.addTrap(this, name, ((JS.CompiledFunction)value), true, rp);
} else {
name = name.substring(1).intern();
Trap t = Trap.getTrap(this, name);
if (t != null) t.delete();
- if (value != null) Trap.addTrap(this, name, ((CompiledFunction)value), false, rp);
+ if (value != null) Trap.addTrap(this, name, ((JS.CompiledFunction)value), false, rp);
}
return;
}