Skip to content
This repository was archived by the owner on Nov 28, 2018. It is now read-only.

Commit ce00689

Browse files
committed
Merge pull request #26 from inolen/master
Use util.inherit for EventEmitter inheritance
2 parents 74008e9 + ad75f9f commit ce00689

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/stomp.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020

2121
// ## Helpers to handle frames, and do parsing
2222

23-
var net = require('net'),
23+
var events = require('events'),
24+
net = require('net'),
2425
tls = require('tls'),
2526
sys = require('util'),
27+
util = require('util'),
2628
frame = require('./frame'),
2729
stomp_utils = require('./stomp-utils'),
2830
exceptions = require('./stomp-exceptions'),
@@ -245,6 +247,8 @@ function send_frame(stomp, _frame) {
245247
// Takes an argument object
246248
//
247249
function Stomp(args) {
250+
events.EventEmitter.call(this);
251+
248252
this.port = args['port'] || 61613;
249253
this.host = args['host'] || '127.0.0.1';
250254
this.debug = args['debug'];
@@ -263,7 +267,7 @@ function Stomp(args) {
263267
};
264268

265269
// ## Stomp is an EventEmitter
266-
Stomp.prototype = new process.EventEmitter();
270+
util.inherits(Stomp, events.EventEmitter);
267271

268272
// ## Stomp.connect()
269273
//

0 commit comments

Comments
 (0)