Skip to content

Commit

Permalink
Missing 'self' in some functions (crossbario#366)
Browse files Browse the repository at this point in the history
var self = this; was not defined, so it raised error: TypeError: Cannot read property 'on_internal_error' of undefined
  • Loading branch information
marablayev authored and oberstet committed Jul 4, 2018
1 parent 6aacb16 commit 84d9585
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ var Connection = function (options) {


Connection.prototype._create_transport = function () {

var self = this;

for (var i = 0; i < this._transport_factories.length; ++i) {
var transport_factory = this._transport_factories[i];
log.debug("trying to create WAMP transport of type: " + transport_factory.type);
Expand All @@ -162,6 +165,9 @@ Connection.prototype._create_transport = function () {
Connection.prototype._init_transport_factories = function () {
// WAMP transport
//

var self = this;

var transports, transport_options, transport_factory, transport_factory_klass;

util.assert(this._options.transports, "No transport.factory specified");
Expand Down

0 comments on commit 84d9585

Please sign in to comment.