Skip to content

Instantly share code, notes, and snippets.

@tjcrowder
Created February 10, 2014 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjcrowder/8912340 to your computer and use it in GitHub Desktop.
Save tjcrowder/8912340 to your computer and use it in GitHub Desktop.
Simple test case for promises and §2.3.3.3
var Promise = require("promise");
var p = new Promise(function(resolve) {
// Return an object with a 'then' property
var obj = {
then: function(res, rej) {
console.log("parg === p? " + (parg === p));
console.log("this === obj? " + (this === obj));
res();
}
};
console.log("Resolving with object with 'then'");
resolve(obj);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment