我正在使用从Backbone改编而来的扩展函数(除了为符合我雇主的命名约定而进行的一些更改外,它们完全相同)来实现原型(prototype)继承。设置以下结构后(下面大大简化)我得到一个无限循环。Graph=function(){};Graph.extend=myExtendFunction;Graph.prototype={generateScale:function(){//dostuff}}//baseclassdefinedelsewhereUsageGraph=Graph.extend({generateScale:function(){this.constructor._s
我是第一次在严格模式下工作,你知道吗,这也是多年来第一次能够使用非严格模式的属性。我的questionhere概述了我遇到的确切问题,但如果我仍然可以访问arguments.callee,我已经制定的解决方案可以适用于更具可扩展性的东西。在不命名函数的情况下,在严格模式下是否有任何方法可以获得对我当前范围内的函数的引用? 最佳答案 WithoutnamingthefunctionisthereanywayinstrictmodethatIcangetareferencetothefunctionwhosescopeI'mcurren