1. Joris van der Burgh
  2. node-nxt-core

Commits

Joris van der Burgh  committed b7c3350

bugfix

  • Participants
  • Parent commits ee43abe
  • Branches default
  • Tags release-0.0.2b

Comments (0)

Files changed (1)

File lib/promises.js

View file
 		},
 		
 		resolve: function(args) { 
-			var err = undefined;
-			p.fulfill(err, args);
+			p.fulfill(undefined, args);
 			//p.fulfill(args);
 			return this;
 		},
 		reject: function(err, data) { 
+			if(err === undefined)  err = new Error("Unspecified error");
 			p.fulfill(err, data);
 			//p.smash(args);			
 			return this;
 		},
+		
+		fulfill: function(err, data) { 
+			p.fulfill(err, data);
+			return this;
+		},
 	
 		promise:function() {	
 			if(!passable) passable = wrapPassable(this /*, p.passable()*/);