UNDO: fixed bug 555
[org.ibex.core.git] / src / org / ibex / core / Ibex.java
index d97a9d5..2b8c7aa 100644 (file)
@@ -1,10 +1,13 @@
 // Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.ibex;
+package org.ibex.core;
 
 import java.io.*;
 import org.ibex.js.*;
 import org.ibex.util.*;
-import org.bouncycastle.util.encoders.Base64;
+import org.ibex.graphics.*;
+import org.ibex.plat.*;
+import org.ibex.net.*;
+import org.ibex.crypto.*;
 
 /** Singleton class that provides all functionality in the ibex.* namespace */
 public final class Ibex extends JS.Cloneable {
@@ -125,7 +128,7 @@ public final class Ibex extends JS.Cloneable {
 
     public void put(Object name, final Object value) throws JSExn {
         //#switch(name)
-        case "thread": Scheduler.add((Scheduler.Task)value); return;
+        case "thread": Scheduler.add((Task)value); return;
         case "ui.clipboard": Platform.setClipBoard((String)value); return;
         case "ui.frame": Platform.createSurface((Box)value, true, true); return;
         case "ui.window": Platform.createSurface((Box)value, false, true); return;
@@ -353,7 +356,10 @@ public final class Ibex extends JS.Cloneable {
         }
         public JSScope getStatic() {
             try {
-                if (t == null) t = Template.buildTemplate(parentkey + ".t", parent.get(parentkey + ".t"), ibex);
+                if (t == null) {
+                    JS res = (JS) parent.get(parentkey + ".t");
+                    t = Template.buildTemplate(res.unclone().toString(), res, ibex);
+                }
                 return t.staticScope;
             } catch (Exception e) {
                 Log.error(this, e);