Skip to content

Commit

Permalink
string_decoder: don't cache Buffer.isEncoding
Browse files Browse the repository at this point in the history
Some modules are monkey-patching Buffer.isEncoding, so without this
they cannot do that.

Fixes: #1547
  • Loading branch information
mscdex committed Apr 28, 2015
1 parent e55fdc4 commit b658db1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/string_decoder.js
Original file line number Diff line number Diff line change
@@ -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);
}
}
Expand Down

0 comments on commit b658db1

Please sign in to comment.