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
16 lines
360 B
JavaScript
16 lines
360 B
JavaScript
return async function () {
|
|
let log = [];
|
|
async function getDisposable() {
|
|
function disposable() { log.push('call') }
|
|
disposable[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")] = () => { log.push('dispose') };
|
|
return disposable;
|
|
}
|
|
|
|
{
|
|
await using x = getDisposable();
|
|
x();
|
|
}
|
|
|
|
expect(log).toEqual(['call', 'dispose']);
|
|
}
|