From: Daniel Cousens Date: Thu, 5 Mar 2015 21:46:01 +0000 (+1100) Subject: index: don't use reserved keyword "byte" X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=e329b50e1f87e765617d86674a1e66b68bf87af1;p=buffer.git index: don't use reserved keyword "byte" --- diff --git a/index.js b/index.js index a526681..147a593 100644 --- a/index.js +++ b/index.js @@ -344,9 +344,9 @@ function hexWrite (buf, string, offset, length) { length = strLen / 2 } for (var i = 0; i < length; i++) { - var byte = parseInt(string.substr(i * 2, 2), 16) - if (isNaN(byte)) throw new Error('Invalid hex string') - buf[offset + i] = byte + var parsed = parseInt(string.substr(i * 2, 2), 16) + if (isNaN(parsed)) throw new Error('Invalid hex string') + buf[offset + i] = parsed } return i }