Last active
August 29, 2015 13:57
-
-
Save briancavalier/9812076 to your computer and use it in GitHub Desktop.
Seriously detailed stacks in when.js 3.1
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
require('../../monitor/console'); | |
var Promise = require('../../when').Promise; | |
function error(){ | |
throw new Error('error'); | |
} | |
Promise.resolve('foo').then(function(){ | |
return Promise.resolve(123); | |
}).then(function(){ | |
return new Promise(function(resolve){ | |
setTimeout(function(){ | |
resolve('abc'); | |
}, 500); | |
}); | |
}).then(function(){ | |
return Promise.resolve('bar').then(function(){ | |
return 456; | |
}); | |
}).then(error); | |
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
Error: error | |
at error (/Users/brian/Projects/cujojs/when/experiments/trace-test/done.js:5:8) | |
from execution context: | |
at Object.<anonymous> (/Users/brian/Projects/cujojs/when/experiments/trace-test/done.js:20:4) | |
from execution context: | |
at Object.<anonymous> (/Users/brian/Projects/cujojs/when/experiments/trace-test/done.js:16:4) | |
from execution context: | |
at Object.<anonymous> (/Users/brian/Projects/cujojs/when/experiments/trace-test/done.js:10:4) | |
from execution context: | |
at Object.<anonymous> (/Users/brian/Projects/cujojs/when/experiments/trace-test/done.js:8:24) |
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
require('../monitor/console'); | |
var Promise = require('../when').Promise; | |
Promise.resolve().then(function f1() { | |
Promise.resolve().then(function f2() { | |
Promise.resolve().then(function f3() { | |
doh(); | |
}); | |
}); | |
}); |
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
ReferenceError: doh is not defined | |
at f3 (/Users/brian/Projects/cujojs/when/experiments/trace.js:7:4) | |
from execution context: | |
at f2 (/Users/brian/Projects/cujojs/when/experiments/trace.js:6:21) | |
from execution context: | |
at f1 (/Users/brian/Projects/cujojs/when/experiments/trace.js:5:10) | |
from execution context: | |
at Object.<anonymous> (/Users/brian/Projects/cujojs/when/experiments/trace.js:4:9) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment