正如arguments.callee将要弃用的那样,我将在下面的表达式中使用而不是arguments.callee`:
var self = this;
this.async(function(){
if(test()){
then();
}else{
self.async(arguments.callee);
}
});
Run Code Online (Sandbox Code Playgroud)
这应该工作.但我不确定它是否适用于所有浏览器.
var self = this;
this.async(function someMethod(){
if(test()){
then();
}else{
self.async(someMethod);
}
});
Run Code Online (Sandbox Code Playgroud)