function f() {
this.n = 'name';
this.onn = null;
if ( this.onn ) {
this.onn();
}
};
var of = new f();
of.onn = function() {
console.log( 1 );
};
var socket = new WebSocket( "example.com:8081" );
socket.onopen = function() {
console.log( 1 );
}