else if (!Surface.button1 && !Surface.button2 && Surface.button3) return new Integer(1);
else return new Integer(0);
}
- else if (name.equals("encodeURI")) throw new Error("not implemented");
- else if (name.equals("encodeURIComponent")) throw new Error("not implemented");
- else if (name.equals("decodeURI")) throw new Error("not implemented");
- else if (name.equals("decodeURIComponent")) throw new Error("not implemented");
else return super.get(name);
}
return null;
}});
- super.put("parseFloat", new JS.Callable() { public Object call(JS.Array args) throws JS.Exn {
- if (args.length() != 1 || args.elementAt(0) == null) return null;
- return new Float(args.elementAt(0).toString());
- }});
-
- super.put("parseInt", new JS.Callable() { public Object call(JS.Array args) throws JS.Exn {
- if (args.length() != 1 || args.elementAt(0) == null) return null;
- return new Float(args.elementAt(0).toString());
- }});
-
+ super.put("parseInt",xwtString.get("parseInt"));
+ super.put("parseFloat",xwtString.get("parseFloat"));
+
super.put("yield", new JS.Callable() { public Object call(JS.Array args) throws JS.Exn {
sleep(0);
return null;
HTTP http = new HTTP(u.toString());
if (Main.originAddr == null) {
try {
- Main.originAddr = InetAddress.getByName(u.getHost());
+ Main.originHost = u.getHost();
+ Main.originAddr = InetAddress.getByName(Main.originHost);
} catch (UnknownHostException e) {
if (Log.on) Log.log(this, "couldn't resolve " + u.getHost() + "; proceeding without permissions");
Main.originAddr = InetAddress.getByName("0.0.0.0");
put("decodeURIComponent",gs.get("decodeURIComponent"));
put("encodeURI",gs.get("encodeURI"));
put("encodeURIComponent",gs.get("encodeURIComponent"));
+ put("escape",gs.get("escape"));
+ put("unescape",gs.get("unescape"));
put("fromCharCode",gs.get("stringFromCharCode"));
setSeal(true);
}