Skip to content

Commit

Permalink
lib: remove string_decoder.js var redeclarations
Browse files Browse the repository at this point in the history
PR-URL: #4978
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and jasnell committed Feb 1, 2016
1 parent ba81d15 commit 68a6abc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/string_decoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ StringDecoder.prototype.write = function(buffer) {
charStr = charBuffer.toString(encoding, 0, charLength);

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

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

0 comments on commit 68a6abc

Please sign in to comment.