diff --git a/lib/encoded.js b/lib/encoded.js index d61c00f..a91b47b 100644 --- a/lib/encoded.js +++ b/lib/encoded.js @@ -111,7 +111,7 @@ Parser.prototype._write = function(data) { Parser.prototype._error = function(err) { this.destroy(); this.emit('error', typeof err === 'string' - ? new Error(err + '') + ? new Error(err) : err); }; diff --git a/lib/json.js b/lib/json.js index 76a923c..439a99c 100644 --- a/lib/json.js +++ b/lib/json.js @@ -378,7 +378,7 @@ Parser.prototype._reset = function() { Parser.prototype._error = function(err) { this.destroy(); this.emit('error', typeof err === 'string' - ? new Error(err + '') + ? new Error(err) : err); }; diff --git a/lib/parted.js b/lib/parted.js index 1cd9816..4210db7 100644 --- a/lib/parted.js +++ b/lib/parted.js @@ -299,7 +299,7 @@ Parser.prototype._reset = function() { Parser.prototype._error = function(err) { this.destroy(); this.emit('error', typeof err === 'string' - ? new Error(err + '') + ? new Error(err) : err); };