PDA

View Full Version : [FIXED][3.0 Core] Template.compile error in ExtJs Core - args not defined



CableDawg
21 Apr 2009, 7:28 AM
On line 2309 on ext-core-debug.js (from the standalone Core package):


compile : function(){
var me = this,
sep = Ext.isGecko ? "+" : ",";

function fn(m, name){
name = "values['" + name + "']";
return "'"+ sep + name + " == undefined ? '' : " + name + args + ")" + sep + "'";
}

eval("this.compiled = function(values){ return " + (Ext.isGecko ? "'" : "[") +
me.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn) +
(Ext.isGecko ? "';};" : "'].join('');};"));
return me;
},

The private method "fn()" references the variable 'args' which is not defined for that method. I think it is just missing as a named argument for the method.

Looking at earlier version of the code and the arguments being passed to the method, I think the fix should be (in green):


function fn(m, name, format, args){
name = "values['" + name + "']";
return "'"+ sep + name + " == undefined ? '' : " + name + args + ")" + sep + "'";
}

evant
21 Apr 2009, 8:00 AM
This has already been fixed in SVN, thanks.