var ecode="("+t+")"; t=eval(ecode); ecode=null; }catch(e){t=null} if(t&&xui.isHash(t)){ xui.each(t,function(evt,name){ if(xui.isArr(evt)) for(var i=0,l=evt.length;i=code.length)return ""; var t1=new Date; var reg2=/(\{(((\{\})|[^\{\}\x01])+)\})|(\[([^\[\]0\x01]+)\])/, reg3=/(((\s*function\s*([\w$][\w]*\s*)?\(\s*([\w$\s,]*)\s*\)\s*)?(\{(((\{\})|[^\{\}\x01])*)\}))|(\[([^\[\]0\x01]+)\]))/g; // add special char code = code.replace(/\x01/g,'0'); code = code.substring(0,index) + "\x01"+ code.substring(index+1,code.length); // clear string/reg,comments code = xui.Coder.replace(code, [ // simplify some [/\r\n?|\n/,"\n"], [/(\uFEFF|\xA0|[\t\x0B\f])/, " "], //protect {"a":1} [/"[\w\$][\w\.]*"\s*\:/,'$0'], [/'[\w\$][\w\.]*'\s*\:/,"$0"], // clear string [/"(\\.|[^"\\\n])*"/,'"a"'], [/'(\\.|[^'\\\n])*'/,"'a'"], // clear reg [/\/(\\[\/\\]|[^*\/])(\\.|[^\/\n\\])*\/[gim]*/,'(new RegExp())'], // clear comments [/\/\*[^*]*\*+([^\/][^*]*\*+)*\//,''], [/\/\/[^\n]*/,''] ]); var t2=new Date; //console.log(t2-t1); // clear all function(){}, {} and [] while(reg2.test(code)){ code = code.replace(reg3, function(a){ return a[0]=="{"?"{}":a[0]=="["?"[0]":"(new Function())" }); } var t3=new Date; //console.log(code,t3-t2); var i=0,k=code.indexOf('\x01'),l=code.length,ignoreComma=true, a1=[],a2=[],a3=[],arr2=[],arr3=[],c,tmp=0,strtmp,prevDo=true; // if code not in any function, return var tests=code.substring(0,k); if(!/\bfunction\b/.test(tests)){ return tests; } // clear those useless code do{ c=code[i++]; if(i