Skip to content

Commit 2f27196

Browse files
committed
fix: fully disable and dispose of unzip when aborting parser
1 parent be440da commit 2f27196

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎src/parse.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,16 @@ export class Parser extends EE implements Warner {
409409
if (this[ABORTED]) {
410410
return
411411
}
412+
if (this[UNZIP]) {
413+
// fully nerf the decompressor and close its underlying binding
414+
const u = this[UNZIP]
415+
/* c8 ignore start */
416+
u.write = () => true
417+
u.end = () => u
418+
u.emit = () => false
419+
/* c8 ignore stop */
420+
u.destroy?.()
421+
}
412422
this[ABORTED] = true
413423
this.emit('abort', error)
414424
// always throws, even in non-strict mode

0 commit comments

Comments
 (0)