summaryrefslogtreecommitdiff
path: root/lib/string_decoder.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2016-01-30 15:08:56 -0800
committerJames M Snell <jasnell@gmail.com>2016-02-01 08:43:40 -0800
commit68a6abc806a0b359f72d73cfeb7ad7fd383f2c8b (patch)
tree61b2855dd4345815e6bf10e2ab5aa003b2abcefe /lib/string_decoder.js
parentba81d152ec14c2cb190279be8d3a519e220e7872 (diff)
downloadandroid-node-v8-68a6abc806a0b359f72d73cfeb7ad7fd383f2c8b.tar.gz
android-node-v8-68a6abc806a0b359f72d73cfeb7ad7fd383f2c8b.tar.bz2
android-node-v8-68a6abc806a0b359f72d73cfeb7ad7fd383f2c8b.zip
lib: remove string_decoder.js var redeclarations
PR-URL: https://github.com/nodejs/node/pull/4978 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/string_decoder.js')
-rw-r--r--lib/string_decoder.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/string_decoder.js b/lib/string_decoder.js
index 0c9fdfb416..ffb04ffff5 100644
--- a/lib/string_decoder.js
+++ b/lib/string_decoder.js
@@ -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 = '';
@@ -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;