mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
* Reduce recursion when disposing sync resources * Fix handling of sync error in `@@asyncDispose` * Make the generated helper slightly smaller
22 lines
388 B
JavaScript
22 lines
388 B
JavaScript
return async function () {
|
|
let disposed = false;
|
|
let beforeEnd;
|
|
|
|
const err1 = {};
|
|
const err2 = {};
|
|
let thrown;
|
|
|
|
try {
|
|
await using x = {
|
|
[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")]() {
|
|
throw err1;
|
|
}
|
|
};
|
|
throw err2;
|
|
} catch (e) {
|
|
thrown = e;
|
|
}
|
|
|
|
expect(thrown.suppressed).toBe(err1);
|
|
expect(thrown.error).toBe(err2);
|
|
}(); |