mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
* rename proposal-explicit-resource-management to transform-explicit-resource-management * update library description * bump Babel/core version requirements to ^7.23.9 * add deprecation reminder * remove outdated reminders * update reminder date
20 lines
425 B
JavaScript
20 lines
425 B
JavaScript
return async function () {
|
|
let log = [];
|
|
|
|
function disposable(name){
|
|
return {
|
|
async [Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")]() {
|
|
log.push(name);
|
|
}
|
|
};
|
|
}
|
|
|
|
{
|
|
await using x = disposable("x");
|
|
await using y = disposable("y"), z = disposable("z");
|
|
await using w = disposable("w");
|
|
log.push("body");
|
|
}
|
|
|
|
expect(log).toEqual(["body", "w", "z", "y", "x"]);
|
|
}(); |