X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FTemplate.java;h=00aedd09328b8975c3ed575df1469c0fc37300f6;hb=fa49b56b41be191e83bcf8222381fee2c4e0355b;hp=df20ee97bffb7a34602c191cb5d6c52a4029c4ba;hpb=ea8d7a51a7c20e9fccacdd7d16b9a3e55a6bd8e3;p=org.ibex.core.git diff --git a/src/org/xwt/Template.java b/src/org/xwt/Template.java index df20ee9..00aedd0 100644 --- a/src/org/xwt/Template.java +++ b/src/org/xwt/Template.java @@ -40,7 +40,7 @@ public class Template { // Instance Members that are only meaningful on root Template ////////////////////////////////////// - private JSScope staticJSScope = null; ///< the scope in which the static block is executed + private JSScope staticScope = null; ///< the scope in which the static block is executed private JSFunction staticscript = null; ///< the script on the static node of this template, null already performed @@ -94,13 +94,13 @@ public class Template { } /** called before this template is applied or its static object can be externally referenced */ - JSScope getStatic() throws JSExn { - if (staticJSScope == null) staticJSScope = new JSScope(null); - if (staticscript == null) return staticJSScope; + JSScope getStatic(XWT xwt) throws JSExn { + if (staticScope == null) staticScope = new PerInstantiationJSScope(null, xwt, null, null); + if (staticscript == null) return staticScope; JSFunction temp = staticscript; staticscript = null; - temp.cloneWithNewParentScope(staticJSScope).call(null, null, null, null, 0); - return staticJSScope; + temp.cloneWithNewParentScope(staticScope).call(null, null, null, null, 0); + return staticScope; } /** Applies the template to Box b @@ -121,7 +121,7 @@ public class Template { private void apply(Box b, XWT xwt, PerInstantiationJSScope parentPis) throws JSExn { - getStatic(); + getStatic(xwt); if (id != null) parentPis.putDollar(id, b); for(int i=0; ii; i++) if (ch[start+i] == '\t') - throw new XML.Exn("tabs are not allowed in XWT files", XML.Exn.SCHEMA, getLine(), getCol()); + Log.error(Template.class, "tabs are not allowed in XWT files ("+getLine()+":"+getCol()+")"); if ("static".equals(nameOfHeaderNodeBeingProcessed) || state == STATE_IN_TEMPLATE_NODE) { if (t.content == null) {