Firefox 18 javascript编译器 IonMonkey 引起的extjs 布局混乱问题

最近测试反应系统在火狐18版本下偶尔会出现页面布局混乱的问题,出现频率还挺高,于是查了下,没有找到具体原因,不过开启firebug调试后,基本就不会出现问题了。在extjs论坛上看到已经有人发帖反应了,原因是由于18采用了最新的js编译引擎IonMonkey,他在编译extjs代码时有个bug导致的,

[b]错误信息[/b]

[quote]TypeError: callOverrideParent.caller is null
.../extjs/ext-all-dev.js Line: 37
[/quote]
具体原因是由于此段代码编译有问题
Ext.Base的callParent方法编译有问题,
[b]解决方法1,覆写callParent方法,加入try catch块[/b]


if (Ext.firefoxVersion >= 18) {
var noArgs = [];
Ext.override(Ext.Base, {
callParent : function(args) {


var method, superMethod = (method = this.callParent.caller) &&
(method.$previous || ((method = method.$owner ?
method :
method.caller) && method.$owner.superclass[method.$name]));


// Workarround for Firefox 18. I don't know why this works, but it does. Perhaps functions wich have 此处加入try catch后编译器将不再编译此方法
// a try-catch block are handled differently
try {} catch (e) {}
return superMethod.apply(this, args || noArgs);
}
});
}

解决方法2:
firefox bug帖子上说18+的版本修复了这个bug,因此17号发布的18.0.1和19beta版应该都没有这个问题了,升级浏览器即可。

[b]附加入try catch后问题解决的原因:[/b]
[quote]
The reason it's not reproducible is because it happens during some JIT compiling, so it's not really something we can "fix", since the symptom happens almost at random. The reason the try/catch works is because methods with try catch blocks don't get compiled.
The FF bug is here: https://bugzilla.mozilla.org/show_bug.cgi?id=818023
[/quote]

[b]参考资料:[/b]
1.extjs问题帖子:[url]http://www.sencha.com/forum/showthread.php?253345-FF-18-problem&s=4bf9757321c9fa4cb39a2ea4f7231662[/url]
2.firefox bug地址:[url]https://bugzilla.mozilla.org/show_bug.cgi?id=818023[/url]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值