Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4433262
test_async_reentrant_resume.cjs
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
728 B
Referenced Files
None
Subscribers
None
test_async_reentrant_resume.cjs
View Options
function assertEq(name, actual, expected) {
if (actual !== expected) {
throw new Error(`${name}: expected ${expected}, got ${actual}`);
}
console.log(`ok ${name}`);
}
(async function() {
const settled = Promise.resolve('ready');
async function leaf(label) {
const value = await settled;
return `${label}:${value}`;
}
async function middle(label) {
return await leaf(label);
}
async function top() {
const out = [];
out.push(await middle('a'));
out.push(await middle('b'));
return out.join(',');
}
assertEq(
'nested async resume on settled promise',
await top(),
'a:ready,b:ready'
);
})().catch((err) => {
console.error(err);
process.exitCode = 1;
});
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Sat, May 2, 5:32 AM (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
543956
Default Alt Text
test_async_reentrant_resume.cjs (728 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment