move getter and setter after the constructor in client.js

This commit is contained in:
Romain Beaumont 2015-09-23 21:03:07 +02:00
parent bbde23bb02
commit 68c589a3b0

View file

@ -24,25 +24,6 @@ class Client extends EventEmitter
deserializer; deserializer;
isServer; isServer;
get state(){
return this.serializer.protocolState;
}
set state(newProperty) {
var oldProperty = this.serializer.protocolState;
this.serializer.protocolState = newProperty;
this.deserializer.protocolState = newProperty;
this.emit('state', newProperty, oldProperty);
}
get compressionThreshold() {
return this.compressor == null ? -2 : this.compressor.compressionThreshold;
}
set compressionThreshold(threshold) {
this.setCompressionThreshold(threshold);
}
constructor(isServer) { constructor(isServer) {
super(); super();
@ -65,6 +46,25 @@ class Client extends EventEmitter
}); });
} }
get state(){
return this.serializer.protocolState;
}
set state(newProperty) {
var oldProperty = this.serializer.protocolState;
this.serializer.protocolState = newProperty;
this.deserializer.protocolState = newProperty;
this.emit('state', newProperty, oldProperty);
}
get compressionThreshold() {
return this.compressor == null ? -2 : this.compressor.compressionThreshold;
}
set compressionThreshold(threshold) {
this.setCompressionThreshold(threshold);
}
setSocket(socket) { setSocket(socket) {
var ended = false; var ended = false;