Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4444557
test_promise_chained_catch_unhandled.cjs
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
646 B
Referenced Files
None
Subscribers
None
test_promise_chained_catch_unhandled.cjs
View Options
const assert = require("node:assert");
const { spawnSync } = require("child_process");
const source = [
"async function explode(){ throw new Error('boom') }",
"explode().then(() => {}).catch(() => console.log('chained-caught'))",
].join(" ");
const result = spawnSync(process.execPath, ["-e", source], {
encoding: "utf8",
});
if (result.error) {
throw result.error;
}
assert.strictEqual(result.status, 0, result.stderr || result.stdout);
assert.match(result.stdout, /chained-caught/);
assert.doesNotMatch(result.stderr, /Uncaught \\(in promise\\)/);
console.log("promise chains with downstream catch are not reported as unhandled");
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Sat, May 2, 10:21 AM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
544202
Default Alt Text
test_promise_chained_catch_unhandled.cjs (646 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment