From 4523012867d4ccb943705c3ab64b60f50aee588c Mon Sep 17 00:00:00 2001 From: "Ryan X. Charles" Date: Fri, 18 Jul 2014 11:40:13 -0700 Subject: [PATCH] set .converters and ._encoding by hand ...revert to previous change, since always calling the constructor of VersionedData may have unintended consequences. Instead, just set .converts and ._encoding, since they are no longer in the prototype and must be set on the object itself. --- lib/SIN.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/SIN.js b/lib/SIN.js index 12f480d0a..314db84aa 100644 --- a/lib/SIN.js +++ b/lib/SIN.js @@ -3,10 +3,13 @@ var EncodedData = require('../util/EncodedData'); var util = require('util'); function SIN(type, payload) { - SIN.super_.call(this, type, payload); - if (typeof type != 'number') + if (typeof type != 'number') { + SIN.super_.call(this, type, payload); return; + } this.data = new Buffer(1 + 1 + payload.length); + this.converters = this.encodings['binary'].converters; + this._encoding = this.encodings['binary']._encoding; this.encoding('binary'); this.prefix(0x0F); // SIN magic number, in numberspace this.type(type);