fix shitty scope

This commit is contained in:
xdrm-brackets 2018-04-06 01:28:27 +02:00
parent 1d7837b6dc
commit 5ed03574a7
1 changed files with 5 additions and 2 deletions

View File

@ -37,8 +37,10 @@ export default class AudioManager{
this._ws = {
stack: [],
send: function(_data){
if( this.ws.readyState !== 1 ) // not connected -> stack
if( this.ws.readyState !== 1 ){ // not connected -> stack
console.warn(`push stack`);
return this._ws.stack.push(_data);
}
console.warn(`send buffer[${_data.length}]`);
this.ws.send(_data);
@ -65,7 +67,8 @@ export default class AudioManager{
fr.onload = function(){
let buf16 = new Int16Array(fr.result);
this.receive(buf16).bind(this);
this.receive(buf16);
}.bind(this);
fr.readAsArrayBuffer(_msg.data);