lib/class.js
function ( fn, context ) {

		// Initialize variables
		this.state = Promise.STATE.INITIALIZED;
		this.handlers = [];
		this.value = fn;

		// Rebind control functions to be run always on this promise
		this.resolve = this.resolve.bind( this );
		this.fulfill = this.fulfill.bind( this );
		this.reject = this.reject.bind( this );

		// Set fn and context
		if ( fn ) {
			if ( typeof fn !== 'function' ) throw new TypeError("fn is not a function");

			this.fn = fn;
			this.context = context || this;

			this.run();

		}

		return this;
	}
function ( fn, context ) {

		// Initialize variables
		this.state = Promise.STATE.INITIALIZED;
		this.handlers = [];
		this.value = fn;

		// Rebind control functions to be run always on this promise
		this.resolve = this.resolve.bind( this );
		this.fulfill = this.fulfill.bind( this );
		this.reject = this.reject.bind( this );

		// Set fn and context
		if ( fn ) {
			if ( typeof fn !== 'function' ) throw new TypeError("fn is not a function");

			this.fn = fn;
			this.context = context || this;

			this.run();

		}

		return this;
	}
function ( fn , context ) { // Initialize variables this . state = Promise . STATE . INITIALIZED ; this . handlers = [ ] ; this . value = fn ; // Rebind control functions to be run always on this promise this . resolve = this . resolve . bind ( this ) ; this . fulfill = this . fulfill . bind ( this ) ; this . reject = this . reject . bind ( this ) ; // Set fn and context if ( fn ) { if ( typeof fn !== 'function' ) throw new TypeError ( "fn is not a function" ) ; this . fn = fn ; this . context = context || this ; this . run ( ) ; } return this ; }
INITIALIZE AND DESTROY METHODS
INITIALIZE AND DESTROY METHODS