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.
This commit is contained in:
parent
098c613cb0
commit
4523012867
@ -3,10 +3,13 @@ var EncodedData = require('../util/EncodedData');
|
|||||||
var util = require('util');
|
var util = require('util');
|
||||||
|
|
||||||
function SIN(type, payload) {
|
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;
|
return;
|
||||||
|
}
|
||||||
this.data = new Buffer(1 + 1 + payload.length);
|
this.data = new Buffer(1 + 1 + payload.length);
|
||||||
|
this.converters = this.encodings['binary'].converters;
|
||||||
|
this._encoding = this.encodings['binary']._encoding;
|
||||||
this.encoding('binary');
|
this.encoding('binary');
|
||||||
this.prefix(0x0F); // SIN magic number, in numberspace
|
this.prefix(0x0F); // SIN magic number, in numberspace
|
||||||
this.type(type);
|
this.type(type);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user