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;
}
if (Platform.detectProxy() == null) throw new HTTPException("could not resolve hostname \"" + host + "\" and no proxy configured");
if (Log.on) Log.log(this, " could not resolve host " + host + "; using xmlrpc.xwt.org to ensure security");
try {
- Array args = new Array();
+ JS.Array args = new JS.Array();
args.addElement(host);
Object ret = new XMLRPC("http://xmlrpc.xwt.org/RPC2/", "dns.resolve").call(args);
if (ret == null || !(ret instanceof String)) throw new Exception(" xmlrpc.xwt.org returned non-String: " + ret);
if (Log.verbose) Log.log(this, "evaluating PAC script");
String pac = null;
try {
- org.xwt.js.Array args = new org.xwt.js.Array();
+ org.xwt.js.JS.Array args = new org.xwt.js.JS.Array();
args.addElement(url.toString());
args.addElement(url.getHost());
Object obj = pacFunc.call(args);