Created
February 10, 2014 08:35
-
-
Save tjcrowder/8912340 to your computer and use it in GitHub Desktop.
Simple test case for promises and §2.3.3.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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