/**
 * Created by obiwankenobi on 11/08/2015.
 */

"use strict";

var then = require("./func/then.js" ),
    reject = require("./func/reject.js" ),
    resolve = require("./func/resolve.js" ),
    accept = require("./func/accept.js" ),
    VALID_STATES = require("./VALID_STATES.js" ),
    utils = require("./utils/utils.js");


/**
 *
 * @constructor
 */
function Promise () {
    this.state = VALID_STATES.PENDING;
    this.onResolvedHandler = utils.unit;
    this.value = undefined;
}

Promise.prototype.then = function ( onSuccess, onError ) {
    return then( this, onSuccess, onError );
};

Promise.prototype.reject = function ( reason ) {
    return reject( this, reason );
};

Promise.prototype.accept = function ( value ) {
    return accept( this, value );
};

Promise.prototype.resolve = function ( x ) {
    resolve( this, x );
    return this;
};


module.exports = Promise;

@@ -104,20 +104,21 @@
 ,%0A    re
-ject
+solve
  = requi
@@ -130,20 +130,21 @@
 /func/re
-ject
+solve
 .js%22 ),%0A
@@ -139,39 +139,38 @@
 olve.js%22 ),%0A    
-resolve
+accept
  = require(%22./fu
@@ -176,32 +176,45 @@
 unc/
-resolve.js%22 )
+accept_reject.js%22 ).accept
 ,%0A    
-accep
+rejec
 t = 
@@ -235,22 +235,36 @@
 c/accept
-.js%22 )
+_reject.js%22 ).reject
 ,%0A    VA

change path