stack overflow at line 7

昨天还好好的代码今天IE就报stack overflow at line 7错,在网上找了下说什么金山毒霸开启上网保护导致,关了无用,重置IE设置也无用,郁闷。
动手调试js发现我在8583报文里面加了个提供小票打印的form类,js复制的时候Ext.getCmp('idno').getValue()写成了Ext.getCmp('idno'),赋值的是Component对象,用Ext.util.JSON.encode
doEncode = function(o){
if(!Ext.isDefined(o) || o === null){
return "null";
}else if(Ext.isArray(o)){
return encodeArray(o);
}else if(Ext.isDate(o)){
return Ext.util.JSON.encodeDate(o);
}else if(Ext.isString(o)){
return encodeString(o);
}else if(typeof o == "number"){
//don't use isNumber here, since finite checks happen inside isNumber
return isFinite(o) ? String(o) : "null";
}else if(Ext.isBoolean(o)){
return String(o);
}else {
var a = ["{"], b, i, v;
for (i in o) {
// don't encode DOM objects
if(!o.getElementsByTagName){
if(!useHasOwn || o.hasOwnProperty(i)) {
v = o[i];
switch (typeof v) {
case "undefined":
case "function":
case "unknown":
break;
default:
if(b){
a.push(',');
}
a.push(doEncode(i), ":",
v === null ? "null" : doEncode(v));
b = true;
}
}
}
}
a.push("}");
return a.join("");
}
}
可能还有别的情况会导致这种错,碰到这个问题,查下可能出现的常见场景,解决不了代码最好调试分析下代码

posted on 2011-12-06 23:50  ferry_passion  阅读(737)  评论(0编辑  收藏  举报