Changeset 2422

Show
Ignore:
Timestamp:
12/04/07 17:46:11 (5 years ago)
Author:
cho45
Message:

lang/javascript/jquery-deferred/jquery-deferred.js:

よりコンパクトに。
なにもかえさないより this かえしたほうがマシだと思うのでそうした

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/jquery-deferred/jquery-deferred.js

    r2418 r2422  
    7878 * This cancels self callback chain. 
    7979 */ 
    80 function Deferred () { 
    81         if (this instanceof Deferred) { 
    82                 this.init.apply(this); 
    83         } else { 
    84                 return new Deferred(); 
    85         } 
    86 } 
     80function Deferred () { return (this instanceof Deferred) ? this.init(this) : new Deferred() } 
    8781Deferred.prototype = { 
    8882        init : function () { 
     
    9286                }; 
    9387                this._next    = null; 
     88                return this; 
    9489        }, 
    9590 
     
    10196        cancel : function () { 
    10297                (this.canceller || function () {})(); 
    103                 this.init(); 
     98                return this.init(); 
    10499        }, 
    105100 
     
    126121                        }, 0); 
    127122                } 
     123                return this; 
    128124        } 
    129125};