Skip to content

Commit 725ad5b

Browse files
Trottrvagg
authored andcommitted
lib: remove string_decoder.js var redeclarations
PR-URL: #4978 Reviewed-By: Brian White <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 2844cc0 commit 725ad5b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/string_decoder.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ StringDecoder.prototype.write = function(buffer) {
9696
charStr = charBuffer.toString(encoding, 0, charLength);
9797

9898
// CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
99-
var charCode = charStr.charCodeAt(charStr.length - 1);
99+
const charCode = charStr.charCodeAt(charStr.length - 1);
100100
if (charCode >= 0xD800 && charCode <= 0xDBFF) {
101101
charLength += surrogateSize;
102102
charStr = '';
@@ -128,8 +128,8 @@ StringDecoder.prototype.write = function(buffer) {
128128
this.charLength = charLength;
129129
charStr += buffer.toString(encoding, 0, end);
130130

131-
var end = charStr.length - 1;
132-
var charCode = charStr.charCodeAt(end);
131+
end = charStr.length - 1;
132+
const charCode = charStr.charCodeAt(end);
133133
// CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
134134
if (charCode >= 0xD800 && charCode <= 0xDBFF) {
135135
charLength += surrogateSize;

0 commit comments

Comments
 (0)