X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6e39d509471fe9b4e2660e0d1631b350d0c66f40..2e847cf21b8ab9d15fa167b315ca5b2fa92638fc:/docs/source/JsonReader.html diff --git a/docs/source/JsonReader.html b/docs/source/JsonReader.html index e6c1b52c..7705458a 100644 --- a/docs/source/JsonReader.html +++ b/docs/source/JsonReader.html @@ -300,14 +300,20 @@ Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, { createAccessor : function(){ var re = /[\[\.]/; return function(expr) { - try { - return(re.test(expr)) ? - new Function('obj', 'return obj.' + expr) : - function(obj){ - return obj[expr]; - }; - } catch(e){} - return Ext.emptyFn; + if(Ext.isEmpty(expr)){ + return Ext.emptyFn; + } + if(Ext.isFunction(expr)){ + return expr; + } + var i = String(expr).search(re); + if(i >= 0){ + return new Function('obj', 'return obj' + (i > 0 ? '.' : '') + expr); + } + return function(obj){ + return obj[expr]; + }; + }; }(),