+ } else {
+ Log.logJS(indent + name + o);
+
+ }
+ }
+
+ public static void sleep(final int i) {
+ final JS.Thread jsthread = JS.Thread.current();
+ final long currentTime = System.currentTimeMillis();
+ final Scheduler.Task task = new Scheduler.Task() { public Object call(Object arg) {
+ if (System.currentTimeMillis() - currentTime < i) {
+ Scheduler.add(this);
+ } else {
+ jsthread.resume();
+ }
+ return null;
+ } };
+ jsthread.pause();
+ Scheduler.add(task);
+ }
+
+ private static class XWTMath extends org.xwt.js.Math {
+ public XWTMath() {
+ JS gs = new JS.GlobalScope();
+ put("isNaN",gs.get("isNaN"));
+ put("isFinite",gs.get("isFinite"));
+ put("NaN",gs.get("NaN"));
+ put("Infinity",gs.get("Infinity"));
+ setSeal(true);
+ }
+ public Object get(Object key) {
+ Object ret = super.get(key);
+ if(ret == null) ret = JS.Math.get(key);
+ return ret;
+ }
+ }
+ private static class XWTString extends JS.Obj {
+ public XWTString() {
+ JS gs = new JS.GlobalScope();
+ put("parseInt",gs.get("parseInt"));
+ put("parseFloat",gs.get("parseFloat"));
+ put("decodeURI",gs.get("decodeURI"));
+ 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);
+ }
+ }
+}