3 ms·
if (!(this instanceof arguments.callee)) { return new arguments.callee(/* parms */); }
by shawndumas 14y ago
if (!(this instanceof arguments.callee)) {
return new arguments.callee(/* parms */);
}
- ufo 14y agoYou can't use arguments.callee when in strict mode. So far the only alternative is to manually encode the class name and argument list: if(!(this instanceof MyClass)){ return new MyClass(a,b,c) }
- shawndumas 14y agoCorrect. But, like John Resig, I am gonna miss it... "Personally, I’m going to miss arguments.callee, I used it in a number of places in my code." -- John Resig (May 22, 2009 at 7:26 am) [1] ---- [1]: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/#comment-384866 http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more...