Skip to content

Commit 257d430

Browse files
committedAug 15, 2017
More extra event emitting to avoid 'premature close'
1 parent 474686b commit 257d430

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎lib/parse.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,20 @@ module.exports = warner(class Parser extends EE {
6868
if (opt.ondone)
6969
this.on(DONE, opt.ondone)
7070
else
71-
this.on(DONE, _ => (this.emit('end'), this.emit('close')))
71+
this.on(DONE, _ => {
72+
this.emit('prefinish')
73+
this.emit('finish')
74+
this.emit('end')
75+
this.emit('close')
76+
})
7277

7378
this.strict = !!opt.strict
7479
this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize
7580
this.filter = typeof opt.filter === 'function' ? opt.filter : noop
7681

7782
// have to set this so that streams are ok piping into it
7883
this.writable = true
84+
this.readable = false
7985

8086
this[QUEUE] = new Yallist()
8187
this[BUFFER] = null

0 commit comments

Comments
 (0)
Please sign in to comment.