Skip to content

Commit 1d85d2c

Browse files
committed
test: ensure immediate disposal of filehandle
1 parent a31f2f7 commit 1d85d2c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/parallel/test-fs-promises-file-handle-dispose.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ async function explicitCall() {
2323
}
2424

2525
async function implicitCall() {
26+
let fh;
2627
{
27-
await using fh = await fs.open(__filename);
28+
await using openHandle = await fs.open(__filename);
29+
fh = openHandle;
2830
fh.on('close', common.mustCall());
2931
}
32+
assert.strictEqual(fh.fd, -1);
3033

3134
let dh;
3235
{

0 commit comments

Comments
 (0)