From 50b05261fd4bb08b643ef0f31b9d8ad8390a9258 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 8 Aug 2016 01:16:12 -0700 Subject: [PATCH] Add explanatory comment In response to @dcposch's feedback --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index 834bea0d..d5347f38 100644 --- a/index.js +++ b/index.js @@ -231,6 +231,9 @@ function fromString (that, string, encoding) { var actual = that.write(string, encoding) if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') that = that.slice(0, actual) }