Skip to content

Instantly share code, notes, and snippets.

@tkissing
Created September 25, 2014 18:24
Show Gist options
  • Save tkissing/5ff2aff41ff3c5740545 to your computer and use it in GitHub Desktop.
Save tkissing/5ff2aff41ff3c5740545 to your computer and use it in GitHub Desktop.
Promise.resolve issue(?)
function ithrow() {
throw Error("Can't do that");
}
p1 = new Promise(function(resolve) {
resolve(ithrow())
});
p1.then(console.log.bind(console, 'p1'), console.warn.bind(console, 'p1'));
p2 = Promise.resolve(ithrow());
p2.then(console.log.bind(console, 'p2'), console.warn.bind(console, 'p2'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment