var charReceived = this.charReceived;
var surrogateSize = this.surrogateSize;
var encoding = this.encoding;
+ var charCode;
// if our last write ended with an incomplete multibyte character
while (charLength) {
// determine how many remaining bytes this buffer has to offer for this char
charStr = charBuffer.toString(encoding, 0, charLength);
// CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
- const charCode = charStr.charCodeAt(charStr.length - 1);
+ charCode = charStr.charCodeAt(charStr.length - 1);
if (charCode >= 0xD800 && charCode <= 0xDBFF) {
charLength += surrogateSize;
charStr = '';
charStr += buffer.toString(encoding, 0, end);
end = charStr.length - 1;
- const charCode = charStr.charCodeAt(end);
+ charCode = charStr.charCodeAt(end);
// CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
if (charCode >= 0xD800 && charCode <= 0xDBFF) {
charLength += surrogateSize;