IE678 使用命名函数 被坑

本人之前有个 习惯 喜欢给函数添加一些 静态属性 方法声明的 结果在IE678 使用命名函数 在函数内部引用函数名 居然不是同一个函数 导致 静态属性方法不能被正常访问 坑到没脾气

上测试代码

var o = {};

o.foo = function xxx(){
    console.log( xxx === o.foo);
    // false    true
    console.log( xxx === arguments.callee );
    // false    true
    console.log( xxx.prototype.constructor === o.foo.prototype.constructor)
    // false    true
    console.log( arguments.callee === o.foo );
    // true     true
};
o.foo()

//被坑道没脾气
原文地址:https://www.cnblogs.com/doop/p/4841731.html