From b658db11e068b304e6f63133b3ee84a9bfe3284b Mon Sep 17 00:00:00 2001 From: Brian White Date: Tue, 28 Apr 2015 10:38:21 -0400 Subject: [PATCH] string_decoder: don't cache Buffer.isEncoding Some modules are monkey-patching Buffer.isEncoding, so without this they cannot do that. Fixes: https://github.com/iojs/io.js/issues/1547 --- lib/string_decoder.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/string_decoder.js b/lib/string_decoder.js index 61a3bb20d588d3..ca09a772b0609d 100644 --- a/lib/string_decoder.js +++ b/lib/string_decoder.js @@ -1,9 +1,7 @@ 'use strict'; -const isEncoding = Buffer.isEncoding; - function assertEncoding(encoding) { - if (encoding && !isEncoding(encoding)) { + if (encoding && !Buffer.isEncoding(encoding)) { throw new Error('Unknown encoding: ' + encoding); } }