リファレンス「厳格な使用」:http://ejohn.org/blog/simple-class-instantiation/ジョンResig氏の単純なクラスのインスタンス化と
// makeClass - By John Resig (MIT Licensed)
function makeClass(){
return function(args){
if (this instanceof arguments.callee) {
if (typeof this.init == "function")
this.init.apply(this, args.callee ? args : arguments);
} else
return new arguments.callee(arguments);
};
}
を同じ機能を実装するための任意のECMAScriptの5準拠した方法がある場合、私は、思っていました。問題は、strictモードではarguments.callee
へのアクセスが推奨されなくなりました。