-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Labels
bugSomething isn't workingSomething isn't workingjscRelated to an issue in JavaScriptCoreRelated to an issue in JavaScriptCore
Description
What version of Bun is running?
0.5.9
What platform is your computer?
Linux
What steps can reproduce the bug?
async function aBroken() {
}
async function bBroken() {
await aBroken();
throw new Error("Oops"); // <-- no stack trace for this throw
}
async function cBroken() {
await bBroken();
}
async function aOkay() {
}
async function bOkay() {
throw new Error("Oops");
await aOkay();
}
async function cOkay() {
await bOkay();
}
async function main() {
try {
await cBroken();
}
catch (e) {
console.log(e);
// >>>(bun)
// 1 | async function aBroken() {
// 2 | }
// 3 |
// 4 | async function bBroken() {
// 5 | await aBroken();
// 6 | throw new Error("Oops");
// ^
// error: Oops
// at /.../throwy.ts:6:10
// >>>(node)
// Error: Oops
// at bBroken (/.../throwy.js:6:11)
// at async cBroken (/.../throwy.js:10:5)
// at async main (/.../throwy.js:27:9)
}
try {
await cOkay();
}
catch (e) {
console.log(e);
//
// >>>(bun)
// 12 |
// 13 | async function aOkay() {
// 14 | }
// 15 |
// 16 | async function bOkay() {
// 17 | throw new Error("Oops");
// ^
// error: Oops
// at /.../throwy.ts:17:10
// at bOkay (/.../throwy.ts:16:20)
// at /.../throwy.ts:22:10
// at cOkay (/.../throwy.ts:21:20)
// at /.../throwy.ts:50:14
// >>>(node)
// Error: Oops
// at bOkay (/.../throwy.js:17:11)
// at cOkay (/.../throwy.js:22:11)
// at main (/.../throwy.js:50:15)
}
}
main();What is the expected behavior?
Expect stack trace for the first case.
What do you see instead?
Stack trace is missing.
// error: Oops
// at /.../throwy.ts:6:10Additional information
Thanks!! :) (Thought that maybe this should be a feature - but the bug reporting template was more useful, so I picked that.)
Thomas-airmatrix, CIB, exrok, giqnt, mmvsk and 43 moremariansam and danilo-silva-funttastic
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingjscRelated to an issue in JavaScriptCoreRelated to an issue in JavaScriptCore