Skip to content

Commit f680ad2

Browse files
committed
fix: pushback doesn't exist for fast decoders
1 parent 9df2491 commit f680ad2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fallback/multi-byte.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ export function multibyteDecoder(enc, loose = false) {
391391
const onErr = loose
392392
? () => REP
393393
: () => {
394-
mapper.pushback.length = 0 // the queue is cleared on returning an error
394+
if (mapper.pushback) mapper.pushback.length = 0 // the queue is cleared on returning an error
395395
// The correct way per spec seems to be not destoying the decoder state in stream mode, even when fatal
396396
// Decoders big5, euc-jp, euc-kr, shift_jis, gb18030 / gbk - all clear state before throwing unless EOF, so not affected
397397
// iso-2022-jp is the only tricky one one where this !stream check matters in non-stream mode

0 commit comments

Comments
 (0)